Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Holding Shift Causes Other Keys to Stick [SOLVED]

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2011
    Posts
    22

    Holding Shift Causes Other Keys to Stick [SOLVED]

    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?

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Holding Shift Causes Other Keys to Stick

    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.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2011
    Posts
    22

    Re: Holding Shift Causes Other Keys to Stick

    Thanks! Added this and all is well:
    Code :
    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.

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Holding Shift Causes Other Keys to Stick

    What do you mean with "an active window" ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •