Results 1 to 7 of 7

Thread: GLUT doesn't recognize 2 keys at once

  1. #1
    Join Date
    Feb 2007
    Location
    Portugal
    Beans
    277
    Distro
    Ubuntu Development Release

    GLUT doesn't recognize 2 keys at once

    Hi all,

    I'm developing an Asteroids clone for college and I'm programming in windows and linux, with OpenGL and GLUT.
    However, the exact same code functions properly in visual studio 2005 whereas the free-glut counterpart does not: When I hold UP and then press RIGHT it only sees UP.

    Is there any way I can install another implementation of GLUT, or any common fix for this?

  2. #2
    Join Date
    Dec 2007
    Location
    UK
    Beans
    571
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: GLUT doesn't recognize 2 keys at once

    I have never used glut, but are you sure you are scanning for keydown, and not keypressed. In the past I found that keypress polling generally gets the first key hit then flushes the input buffer. Maybe you need another event polling command?

  3. #3
    Join Date
    Feb 2007
    Location
    Portugal
    Beans
    277
    Distro
    Ubuntu Development Release

    Re: GLUT doesn't recognize 2 keys at once

    I'm using a library that notifies classes when a key is pressed and or released. I assume the code is not the problem, as it works fine in windows...

  4. #4
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: GLUT doesn't recognize 2 keys at once

    I would suggest not using GLUT for serious tasks as it was made to get a window with opengl open with least code possible and for some keyboard/mouse event handling.

    I would suggest that you look at SDL as it provides more ways in which you can handle key presses and events.
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  5. #5
    Join Date
    Feb 2007
    Location
    Portugal
    Beans
    277
    Distro
    Ubuntu Development Release

    Re: GLUT doesn't recognize 2 keys at once

    It's for college, I can't exactly choose
    Thanks anyway

  6. #6
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: GLUT doesn't recognize 2 keys at once

    is GLUT a requirement? you can use OpenGL with SDL ...
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  7. #7
    Join Date
    Feb 2007
    Location
    Portugal
    Beans
    277
    Distro
    Ubuntu Development Release

    Re: GLUT doesn't recognize 2 keys at once

    Yes it is... Along with another lib they provide which I compiled in linux too =/

Bookmarks

Posting Permissions

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