View Full Version : Modifier Key Input Question

06-29-2011, 06:29 PM

I have been trying to find a way for OpenGL to recognize a the use of a single modifier key. The function glutGetModifiers() will only work if some other input is called at the same time.

A simple example of what I am looking for could be a feature in photoshop / gimp, where when the user is in the line draw state, they can hold down the shift key, and the line becomes orthogonal.

Is there any way to accomplish this in OpenGL?


06-30-2011, 01:36 PM
Technically, glut is not OpenGL.
Glut is good to start with, until you need some special feature that is not provided.

You can use any other event handler system, GLFW, wxWidgets, ...
Or even low level platform dependent APIs.

06-30-2011, 07:48 PM
Is it possible to use GLUT and GLFW in conjunction? (i.e. Have a program written with GLUT, and has GLFW running along side of it for user input). Or would such a thing be unadvised?


Alfonse Reinheart
06-30-2011, 09:22 PM
I'm not sure why you would want to, since GLUT has input functionality, but in general no. Input comes to a particular window, so GLFW has to either control the window or be given it in order for that to work. And I'm fairly sure that FreeGLUT doesn't have a way to get its platform-specific window object (and no, glutGetWindow doesn't count), nor does GLFW have a way to give it a platform-specific window object.