xDexx
2003.05.05, 01:16 AM
i set up this code:
in main
glutKeyboardFunc(checkNormKeys);
then in checkNormKeys()
if (key =='d')
scrollLeft();
else if(key == 'a')
scrollRight();
else if(key == 's')
scrollUp();
else if(key == 'w')
scrollDown();
the code works, but it only does one key at a time, how would i enable it to do two keys at once? like if 'd' makes a character move left and 'w' makes it move up, then they are both pressed at the sometime i want it to move up and left at the same time. any ideas?
-brett
in main
glutKeyboardFunc(checkNormKeys);
then in checkNormKeys()
if (key =='d')
scrollLeft();
else if(key == 'a')
scrollRight();
else if(key == 's')
scrollUp();
else if(key == 'w')
scrollDown();
the code works, but it only does one key at a time, how would i enable it to do two keys at once? like if 'd' makes a character move left and 'w' makes it move up, then they are both pressed at the sometime i want it to move up and left at the same time. any ideas?
-brett