PDA

View Full Version : Detecting key events



dovkruger
03-09-2004, 07:45 PM
glut seems to support only a limited number of key events. I want to detect key state for the shift key, control, alt, etc, in order to be able to detect a shift-click, for example.

Is there any way to do this in glut, and if not, does anyone have portable X code to do it, that I can encapsulate since there is obviously equivalent windows code to do it on that platform....

thanks!
Dov

malancha
03-22-2004, 11:58 PM
Use glutGetModifiers.

This will allow you to detect Shift, Ctrl, and Alt. Unfortunately, to the best of my knowledge it only allows you to detect one of them at a time -- there's no way to detect a Shift-Ctrl-Click, for example.

If you do find a way to handle multiple simultaneous modifiers, please post it here.

marcus256
03-28-2004, 11:46 PM
Try GLFW (http://glfw.sf.net) . It has all the keyboard support you can dream of (?) :D