Hello! I'm trying to make a simple game controlled...
# compose-desktop
p
Hello! I'm trying to make a simple game controlled by the keyboard but
Window.onKeyEvent
is adding a delay after the first
KeyDown
. Any way to use a lower-level API for keyboard events or to remove the delay?
a
I don’t think so; not without going native anyway. It’s a system setting on macOS/Windows.
But google for how to do it in Java; maybe there’s a flag or something.
p
gotcha, thanks!
FWIW, I solved it by looking at the keyup-keydown events, setting properties like
isFiring
in the game state and dealing with repetition myself. I would have had to end up doing the same thing anyway.
a
Sounds perfectly reasonable.