GLUT Keyboard callback issues with C?

A common thing in games is a keyboard array. Therefore you will be also able to press several buttons at a time.

A common thing in games is a keyboard array. Therefore you will be also able to press several buttons at a time. You have an array where you keep state of keys (you put 1 when you get pressed, set 0 when released).

And you process game in each frame by taking information just from array, not directly from input.

Thanks, that's a great answer. Seems so simple! – Jamie White Mar 23 at 21:04.

Here is some code from one of my projects: bool keyDown256; ... //Called when a key is pressed void handleKeypress(unsigned char key, int x, int y) { keyDownkey = true; } void handleKeyUp(unsigned char key, int x, int y){ keyDownkey = false; } This essentially keeps an array of the states of each key, so you can just check them each time. Then you don't have to depend on the callbacks coming in that frequently.

Thanks man, that seems so simple now I think about it! – Jamie White Mar 23 at 21:05.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions