Hi,
I’ve completed my first openGL program (under Mandrake Linux 9.0 using the Gnome desktop). I use glutKeyboardFunc(keyboard) to capture keystrokes in a function ‘keyboard’, and this works. One problem is that it only detects key presses. I would like to do one or both of the following:
I would like to detect key releases.
I would like to scan the keyboard at any time and read the state of the keys.
You can use the glutKeyboardUpFunc function for key releases if your GLUT_XLIB_IMPLEMENTATION >= 13 which should be the case if you are using GLUT 3.7 or greater. As far as a key map… I do not believe it is currently implemented though you could probably use an STL std::map to track current keyboard state.
Thanks. I’ve now got glutKeyboardUpFunc working. (I am using OpenGL Programming Guide third edition (for version 1.2) and it doesn’t refer to glutKeyboardUpFunc.)
Ray