mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 05:41:51 +09:00
CCAPI update as "bit" is now an alias of "bit32"
Former-commit-id: 68c272908747e3ab451799b4cddd211fbee09489 Former-commit-id: aeaa3e995030501175d3692248a1a3cc2d9bfcfa
This commit is contained in:
@@ -22,14 +22,14 @@ class Input(globals: Globals, computer: BaseTerrarumComputer) {
|
||||
val keys_caps = intArrayOf(Key.CAPS_LOCK, Key.BACKSPACE, Key.L_CONTROL)
|
||||
}
|
||||
|
||||
class IsKeyDown(val computer: BaseTerrarumComputer) : OneArgFunction() {
|
||||
class IsKeyDown(val host: BaseTerrarumComputer) : OneArgFunction() {
|
||||
override fun call(keyCode: LuaValue): LuaValue {
|
||||
val key = keyCode.checkint()
|
||||
|
||||
// L_Alt and L_COMMAND are homogeneous
|
||||
if (keys_alt.contains(key)) {
|
||||
for (k in keys_alt) {
|
||||
val down = computer.input.isKeyDown(k)
|
||||
val down = host.input.isKeyDown(k)
|
||||
if (down) return LuaValue.valueOf(true)
|
||||
}
|
||||
}
|
||||
@@ -37,12 +37,12 @@ class Input(globals: Globals, computer: BaseTerrarumComputer) {
|
||||
// Caps, Backspace, L_Control, for Colemak and HHKB
|
||||
if (keys_caps.contains(key)) {
|
||||
for (k in keys_caps) {
|
||||
val down = computer.input.isKeyDown(k)
|
||||
val down = host.input.isKeyDown(k)
|
||||
if (down) return LuaValue.valueOf(true)
|
||||
}
|
||||
}
|
||||
|
||||
return LuaValue.valueOf(computer.input.isKeyDown(keyCode.checkint()))
|
||||
return LuaValue.valueOf(host.input.isKeyDown(keyCode.checkint()))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user