Archived

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

nagromo

Glut's capabilities...?

Recommended Posts

Is it possible to distinguish the numpad numbers from the regular numbers and arrows with Glut? I mostly like it, but I can''t figure out how to treat the numpad differently.

Share this post


Link to post
Share on other sites
from memory the normal number keys can be checked using ''1'' and ''2'' etc, whereas numpad keys have special virtual key codes, something like VK_NUMPAD0 and VK_NUMPAD1 etc i think

arrow keys have codes VK_LEFT VK_RIGHT VK_UP and VK_DOWN

hope it helps
Hybrid

Share this post


Link to post
Share on other sites
Hybrid, those sound like Windows virtual key codes (hence the VK_ prefix). Which is actually probably what you want to use, nagromo -- GLUT is pretty much the barest-bones solution to user input that they could write and still call it a solution. You don't even get key-up messages!

So, what you'll probably need to do is re-write your app to use the operating system's windowing API directly -- check out nehe.gamedev.net; they've got tutorials about everything from setting up your first OpenGL window to shadows and collision detection.

Edit: guess I was wrong about the key-up messages. But GLUT is still pretty bare-bones.

[edited by - CautionMan on March 28, 2004 6:42:52 PM]

Share this post


Link to post
Share on other sites