Fix: alt+f4 changing display mode - #257
Conversation
input.getKeyState accepts beatoraja key index, not libgdx keycode
|
I understand the error, but I'm not convinced this is the right way to fix it? Changing the code to directly calling into gdx rather than using the existing input support seems odd. In particular, while #168 isn't merged yet, I'm not sure this method will even safely work once |
|
Rationale behind using Gdx.input.iskeypressed.
This PR attempt to use getasynckeystate instead of gdx.input.iskeypressed on a polling thread. I'm noticing some key drops so this might require alternative backend like, jni-ing with raw input api on windows, but it is quite flexible. I'm not sure if this is better or processing key input on main thread is better, but I think polling thread is pretty norm, and making the game engine's main loop invariant to the exact time the it is run (not doing all the judging or scoring / maybe networking on multiplayer) seems less fragile to unexpected events. On implementing that patch I had to make this commit. Which is, cause alt+f4 is a windows event, it should be processed by windows event listener which also is what previous version of libgdx2 lwjgl / glfw key system used. This is not an exact rationale, but I guess to process something related to the OS it may be better to use a key system that is coupled with the event system. Which is Gdx.key.iskeypressed here.
|
input.getKeyState accepts beatoraja key index, not libgdx keycode.
I guess this would have been an obvious typo.