• Advertisement

Archived

This topic is now archived and is closed to further replies.

glut & numpad key

This topic is 6023 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How could I detect if the numpad key are pressed? glut does not send message to the glutKey* or glutSpecialKey callback!

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
If numlock is on, then glutKeyboardFunc/glutKeyboardUpFunc will register it. If it''s off, then glutSpecialFunc/glutSpecialUpFunc will register it.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
glutKeyboardFunc will register ''1'' through ''9''

glutSpecialFunc will register GLUT_KEY_UP, GLUT_KEY_DOWN, GLUT_KEY_LEFT, or GLUT_KEY_RIGHT.

Share this post


Link to post
Share on other sites
"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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

  • Advertisement