Hi!
I want to get notified when one of the SHIFT keys goes down and comes up again. While my program works fine for LSHIFT, it seems I have no luck with RSHIFT. ???
Concretely, I use the modifed KeyboardTest example from the LWJGL site. My shortened (test) method wiggleKeyboard() is shown below. As in the KeyboardTest example it is called in every frame.
private void wiggleKeyboard()
{
Keyboard.poll();
if(Keyboard.getNumKeyboardEvents() > 0)
System.out.println("Count: "+Keyboard.getNumKeyboardEvents());
while (Keyboard.next())
{
System.out.println(Keyboard.isKeyDown(Keyboard.getEventKey())+", "+Keyboard.getEventKey()+", "+Keyboard.getKeyName(Keyboard.getEventKey()));
}
}
Holding the left shift key and pressing the down-key 3 times simultaneously, the program outputs:
Count: 1 true, 42, LSHIFT Count: 1 true, 208, DOWN Count: 1 false, 208, DOWN Count: 1 true, 208, DOWN Count: 1 false, 208, DOWN Count: 1 true, 208, DOWN Count: 1 false, 208, DOWN Count: 1 false, 42, LSHIFT
which is exactely what I expected. However, when I repeat the same test but with pressing the right (!) shift key instead of the left shift key I get the following output:
Count: 1 true, 54, RSHIFT Count: 2 false, 54, RSHIFT true, 208, DOWN Count: 2 false, 208, DOWN true, 54, RSHIFT Count: 2 false, 54, RSHIFT true, 208, DOWN Count: 2 false, 208, DOWN true, 54, RSHIFT Count: 2 false, 54, RSHIFT true, 208, DOWN Count: 2 false, 208, DOWN true, 54, RSHIFT Count: 1 false, 54, RSHIFT
According to the output I keep pressing and releasing the right shift key… but I am not :-\ Is that the intended behavior? Is there a way to simulate the behavior of the left shift key?
Thanks in advance,
Johannes