View Full Version : Detecting key events

03-09-2004, 06: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....


03-22-2004, 10: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.

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