PDA

View Full Version : Using Arrow keys in OpenGL



akya
10-04-2005, 08:17 AM
Hello, i'm relatively new to opengl but am taking a graphics class to learn more.

anyway, right now the program i'm working on displays a picture, then allows the user to pan left, right, up, and down, and also zoom in and out using letters on the keyboard.

i would like to use the arrow keys instead of letters.

perhaps there is an ascii value i do not know?

i spose this relates to all c++ programming. but if you have any insight let me know.

ZbuffeR
10-04-2005, 08:42 AM
Arrow keys are not part of ascii.
http://en.wikipedia.org/wiki/ASCII

Arrow keys are even not part of OpenGL ;)
If you happen to use GLUT, have a look here for the constants defined for left/right keys etc:
http://www.lighthouse3d.com/opengl/glut/index.php?5

Else, well go see the doc of the API you use for testing keyboard key presses (and not ASCII values).

akya
10-04-2005, 03:31 PM
Thanks. i got it to work using GLUT as you suggested.