View Full Version : glut key-down func?

10-11-2004, 05:15 PM

I'd like to use a held-down key as a modifier to a command. For example, in Maya, if you hold the alt key down the mouse buttons act as navigation tools regardless of what tool is selected. I know the glut keyboard func works to record what key was pressed, but is there a glut function that is recording what key is currently down? Or do I need to go to a more full-featured ui builder than glut?

Thanks for any help!

10-11-2004, 10:57 PM

If you only want to know if the shift, alt or ctrl key is held down, you can use glutGetModifiers() to query its state, when a keyboard or mouse callback function is entered.
helpful link (http://www.opengl.org/resources/libraries/glut/spec3/node73.html#SECTION000104000000000000000)

10-12-2004, 06:54 AM
Thanks, Sumpfratte!

That's just what I'm looking for.

10-29-2004, 07:15 PM
Yeah, that's something we've been thinking of
adding to OpenGLUT (http://www.openglut.org) .
The ability to query keyboard state, as well
as receive keyboard events.


Nigel Stewart