Thread: glut - keyboard/mouse-func question

  1. #1
    Registered User
    Join Date
    Aug 2001

    glut - keyboard/mouse-func question

    is there a way to query the key state using glut?

    there are 2 functions for setting a handler for keyboard events
    /glutKeyboardFunc and glutKeyboardUpFunc). so as long as the window has the focus, for every keydown event i get a key up event. but if the window loses the focus (e.g. on my system if i simply move the mouse cursor out of the window) i do not get a key up event if there has been a previously key down event.

    edit: and i guess the same happens to mouse events

    should i use sdl instead?
    signature under construction

  2. #2
    Join Date
    Jan 2006
    I don't know of a way. I use GLUT for my OpenGL prototypes, but I'm going to use SDL for my main game.
    should i use sdl instead?
    I think you should; GLUT is actually quite limited -- more high-level and easy-to-use, but not that flexible.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  2. a newbie question about GLUT
    By tomy in forum Game Programming
    Replies: 1
    Last Post: 12-31-2008, 01:44 PM
  3. glut question
    By Thantos in forum Game Programming
    Replies: 3
    Last Post: 12-27-2004, 11:52 AM
  4. GLUT question <please help!>
    By psychopath in forum Game Programming
    Replies: 5
    Last Post: 05-15-2004, 10:15 AM
  5. Question...
    By TechWins in forum A Brief History of
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM