:beetle: My game also uses keyboard controls. It s...
# korge
t
🪲 My game also uses keyboard controls. It seems the key handling changed during one of the last updates. Both, the number 1 and the numpad 1 are mapped to the same N1 enum. So it's not possible to detect key events of the normal numbers.
Copy code
stage.onKeyDown {
   log.debug { "Pressed key: $it.key" }
}
| It's always
N1
for Numpad and normal numbers But it should also return
KP_1
. This is the behavior if numlock is enabled. If it's disabled, the numpad keys are mapped to the arrows DOWN, UP, LEFT & RIGHT
d
Which target?
t
It happens on JS and JVM. SImple test: Add one of these three vairants to the
onKeyDown
action: when (key) { Key.N1 -> println("Keyboard 1 & Numpad 1") } when (key) { Key.NUMPAD1 -> println("Keyboard 1 & Numpad 1") } when (key) { Key.KP_1 -> println("No Keyboard & No Numpad") }
👍 1