LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: CalibeR.50 on December 06, 2012, 09:37:46

Title: Keyboard and Mouse at the same time - Canvas
Post by: CalibeR.50 on December 06, 2012, 09:37:46
Hi,

I have a problem with the Keyboard in LWJGL. I want to listen to the keyboard by doing Keyboard.isKeyDown(). At the same time I want to listen to the mouse with Mouse.isButtonDown(). The Problem is, if I klick the .ouse while I press a Key, the Keyboard.isKeyDown() method returns false.

I use a Canvas to display.


Using the method of the tutorial in the wiki (link (http://www.lwjgl.org/wiki/index.php?title=LWJGL_Basics_2_(Input))), I get the following debug output if I first press S, then press my mouse and after a while release the mouse and the key:


S Key Pressed
MOUSE DOWN @ X: 571 Y: 427
S Key Released
MOUSE DOWN @ X: 571 Y: 427
MOUSE DOWN @ X: 571 Y: 427
MOUSE DOWN @ X: 571 Y: 427
MOUSE DOWN @ X: 571 Y: 427
MOUSE DOWN @ X: 571 Y: 427
S Key Released


As you can see, once I press the mouse, the key state will change to not pressed. Keyboard.isKeyDown will also return false.


Is there any solution for this problem?

CalibeR.50
Title: Re: Keyboard and Mouse at the same time - Canvas
Post by: kappa on December 06, 2012, 09:51:20
Its a bug in LWJGL 2.8.5 that has been fixed already, use latest nightly builds of LWJGL.
Title: Re: Keyboard and Mouse at the same time - Canvas
Post by: CalibeR.50 on December 06, 2012, 10:01:13
works fine, thank you