keyboard hit

Hi, I have some code in which if I press an arrow button on the keyboard a function is called.

The problem is is that when the arrow key is held down (which needs to happen) the function is repeatedly called.

Does anyone know of any code in which I can adapt this in order to only call the function once???


Keyboard handling has not much to do with OpenGL.
You are probably using GLUT currently ?

IMHO using GLFW instead will be much easier for you, as you can check each key for its status; up or down. Useful for game controls, when you don’t need to read characters.