Odd RSHIFT Behavior

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

You could try to check whether this is the behaviour of the keyboard by ‘porting’ the code to AWT and see what happens in the keyPressed/keyReleased methods.

To prevent wrong behaviour you could ‘cache’ the input-events so that the release after the press, cancels out both events, but that is kinda obvious.

Other than that I have no solution.

Please post more context information: LWJGL version? OS version? It seems to work fine here on linux, using subversion HEAD.

  • elias

I managed to reproduce this on my windows xp sp2 with the latest LWJGL. It seems to be a DirectInput issue, I’m afraid, and this posting supports that:

http://eab.abime.net/showthread.php?p=193507

  • elias

Thanks for your help!

Johannes

PS: I use win xp sp2 (american version though, not German, but it seems to be affected too according to your mentioned thread) with lwjgl 1.0-beta.