PDA

View Full Version : Keyboard inputs



deadweight89
11-27-2003, 03:57 AM
Can anyone suggest a method to gain keyboard inputs from multiple keys fast. The only method i have seen is switch/case statements which is only allowing 1 key at a time and to me seems a very poor method of input.

Any help is appreciated!

Thanks Chris

nexusone
11-27-2003, 06:25 AM
You think you are talking about the glut library keyboard input, another option is to look at the SDL library over glut it has more advance keyboard routines.


Originally posted by deadweight89:
Can anyone suggest a method to gain keyboard inputs from multiple keys fast. The only method i have seen is switch/case statements which is only allowing 1 key at a time and to me seems a very poor method of input.

Any help is appreciated!

Thanks Chris

Deiussum
11-27-2003, 08:36 AM
You can also keep track of the state of the keys you care about, and just set the state with the key up/down callbacks. Then you can easily test for multiple key presses.

Alternatively, you could use functions that can check the state of particular keys instead of relying on the callback functions at all. For instance in Windows, you could use GetAsyncKeyState()