Hmm, I think I found the bug, as you said it seems to be a bug with lwjgl.
for following
public void onKeyEvent(KeyInputEvent evt) {
if (evt.isPressed()) {
System.out.println(evt.toString());
}
}
For any key I press and hold I will get 0 key code as result :
Key(CODE=0, CHAR=s, PRESSED)
Key(CODE=0, CHAR=s, PRESSED)
Key(CODE=0, CHAR=s, PRESSED)
Key(CODE=0, CHAR=s, PRESSED)
Key(CODE=0, CHAR=s, PRESSED)
Key(CODE=0, CHAR=d, PRESSED)
Key(CODE=0, CHAR=d, PRESSED)
Key(CODE=0, CHAR=d, PRESSED)
Key(CODE=0, CHAR=d, PRESSED)
Key(CODE=0, CHAR=d, PRESSED)
Key(CODE=0, CHAR=d, PRESSED)
but see this one
public void onKeyEvent(KeyInputEvent evt) {
if (evt.isRepeating()) {
System.out.println(evt.toString());
}
}
this will return correct key code
Key(CODE=31, REPEATING)
Key(CODE=31, REPEATING)
Key(CODE=31, REPEATING)
Key(CODE=31, REPEATING)
Key(CODE=31, REPEATING)
Key(CODE=31, REPEATING)
Key(CODE=32, REPEATING)
Key(CODE=32, REPEATING)
Key(CODE=32, REPEATING)
Key(CODE=32, REPEATING)
Key(CODE=32, REPEATING)
Key(CODE=32, REPEATING)