LWJGL
May 21, 2012, 00:49:43 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Keyboard.isKeyDown Bug  (Read 2430 times)
laginimaineb
Newbie
*
Posts: 18


« on: May 04, 2007, 13:10:38 »

Hello, I am currently using the new release of LWJGL in my new game (to be released at 2008  Tongue). Anyway, I have stumbled across something which I believe is a bug (I am not 100% sure). It appears that Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) returns true when only the Left Shift button is down, however, when another key such as one of the arrow keys, is pressed whilst the Left Shift is down - the method returns false. Perhaps this is not a bug, however, it is unexpected.

With Thanks,
laginimaineb.
Logged
bobjob
Prolific Timewaster
****
Posts: 335


LWJGL: WOW SO GOOD


« Reply #1 on: May 04, 2007, 13:17:08 »

im currently running windowsXP dont have that problem

System.out.println(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT));

i put that im my main game loop, and displayed true when shift was down, even when other keys are down.

could it be that in your keyboard check you have done something like:

if {
} else if {
} else if {
}

instead of
if {
}
if {
}
if {
}

i know its a basic idea but i cant think of anything else Undecided
Logged

LWJGL Benchmark online test:
http://have2chat.net/benchmark/
http://have2chat.net/benchmark/fullpage.html (run full OpenGL webpage)
laginimaineb
Newbie
*
Posts: 18


« Reply #2 on: May 05, 2007, 02:36:20 »

No, I actually created a new program to test this. In my program the only thing I do is print out the states of several keys including the Left Shift (no elses, just ifs Tongue). Anyway, this is easily reproducible and I'll be happy to send you the sample program. (By the way, I just noticed I am using 1.0 which is actually not the most current edition, maybe this has already been fixed).

With Thanks,
laginimaineb.
Logged
bobjob
Prolific Timewaster
****
Posts: 335


LWJGL: WOW SO GOOD


« Reply #3 on: May 05, 2007, 03:19:22 »

try make a program that prints ONLY the state of shift, then press other keys with shift, if it that works fine then the problem is in the coding, otherwise thats bizzzzar

 Tongue gotta get you back   Wink
Logged

LWJGL Benchmark online test:
http://have2chat.net/benchmark/
http://have2chat.net/benchmark/fullpage.html (run full OpenGL webpage)
laginimaineb
Newbie
*
Posts: 18


« Reply #4 on: May 05, 2007, 06:41:23 »

I have built a simple application which only prints out whether or not the Left Shift button is pressed. The application shows that when a different key is pressed after the Left Shift, the method suddenly returns false, even though the shift is still pressed.

With Thanks,
laginimaineb.
Logged
Matzon
Administrator
Demigod
*****
Posts: 2177



« Reply #5 on: May 05, 2007, 08:35:27 »

some keyboards have a limit as to how many keys can be registered as being down at the same time, though this is usually within a region. You might have such a keyboard.
Logged

http://certusgames.com (Free Online Multiplayer Java Games)
http://lwjgl.org (OpenGL/OpenAL for Java)
laginimaineb
Newbie
*
Posts: 18


« Reply #6 on: May 06, 2007, 07:51:38 »

Oh ok, thanks. Didn't think my keyboard would be limited to 2 keys, though (it only takes another key press to cancel the Shift) since I just bought this new Microsoft keyboard. Oh well, good to know.

With thanks,
laginimaineb.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!