PDA

View Full Version : Holding Shift Causes Other Keys to Stick [SOLVED]



g0bl1n
09-18-2011, 12:24 AM
If I hold down shift, then press a button, that button's up function is never called, thus the key sticks. When using WASD for camera movement the shift key is sometimes pressed, and my camera just keeps going and going. Any way of fixing this?

ZbuffeR
09-18-2011, 01:20 AM
Propably that when shift is used, the ascii value changes, ie. 'w' becomes 'W'.

If you used GLFW instead of GLUT since the beginning you would not have had all these problems, by the way.

g0bl1n
09-18-2011, 02:03 AM
Thanks! Added this and all is well:

if((_keyboardDown[key]>=97||_keyboardDown[key]<=122)&amp;&amp;key>=32)
{
_keyboardDown[key-32]=false;
}

if((_keyboardDown[key]>=65||_keyboardDown[key]<=90)&amp;&amp;key<=223)
{
_keyboardDown[key+32]=false;
}
I will check out GLFW nonetheless, I'm guessing it's another management library for OpenGL. So far Glut does everything I need except for this and an active window. But I'm working on a work around for that as well, so hopefully I'll figure something out soon.

ZbuffeR
09-18-2011, 05:48 AM
What do you mean with "an active window" ?