register 2 simultaneous keypress'
I have written a program in opengl using c++ and i want to be able to fly along my scene by using the keyboard so far i have managed to do this using various functions however i would like to be able to push two buttons at once so i can move in two seperate directions at the same time. Currently i use a switch statement that listens for key strokes any ideas on how i can make it listen for two?
Code:
void keyboard(unsigned char key, int x, int y)
{
char c='#';
switch(key)
{
case('w'):
moveFlat(1);
break;
case('s'):
moveFlat(-1);
break;
case('q'):
moveUp(1);
break;
}
glutPostRedisplay();
}
This is the code i use to listen for key strokes. Many Thanks