glut & numpad key

Started by
5 comments, last by bobatefrei 22 years, 9 months ago
How could I detect if the numpad key are pressed? glut does not send message to the glutKey* or glutSpecialKey callback!
Advertisement
If numlock is on, then glutKeyboardFunc/glutKeyboardUpFunc will register it. If it''s off, then glutSpecialFunc/glutSpecialUpFunc will register it.
That''s what I thought but... It doesn''t work!!! Verr Num off or on, glutKeyboardFunc/glutKeyboardUpFunc or glutSpecialFunc/glutSpecialUpFunc don''t register it!

Have you check on your computer?
glutKeyboardFunc will register ''1'' through ''9''

glutSpecialFunc will register GLUT_KEY_UP, GLUT_KEY_DOWN, GLUT_KEY_LEFT, or GLUT_KEY_RIGHT.
"glut does not send message to the glutKey* or glutSpecialKey callback"

That may be because those aren''t the callbacks... they''re supposed to be glutKeyboardFunc and glutSpecialFunc. You probably meant that, though, because I would imagine having the wrong function names would generate an error.
I use glutKeyboardFunc and glutSpecialFunc... If I write glutKey*, it is just because there is 2 set of functions (for key up and key down event).

I think my problem is due to my azerty keyboard (I''m french), but I don''t know how to solve it.
I suppose that could be part of the problem, but I doubt it. The OS gets all the keyboard info first, so by the time GLUT gets it all it is is an ASCII code. It shouldn''t know the difference.

Can you post some code?

This topic is closed to new replies.

Advertisement