I know that you can use
case ‘27’:
to check for the esc key, but what about the arrows, or shift keys.
Where can i find a list for this?
I know that you can use
case ‘27’:
to check for the esc key, but what about the arrows, or shift keys.
Where can i find a list for this?
use glutSpecialFunc which does the same thing as glutKeyboardFunc but for ‘special’ keys:
void specialFunc(int key, int x, int y) { switch(key){ case GLUT_KEY_UP: break; case GLUT_KEY_F1: break; case GLUT_KEY_PAGE_DOWN: break; } } //init ... glutSpecialFunc(specialFunc); ...
see glut.h for more info (also check glutSpecialUpFunc)
Carl
[This message has been edited by dUckmAnn (edited 07-05-2001).]
do a search in the help files for “ascii character codes” or at m$ msdn site (i am sure there are more sites out there with this information).
it will show a chart of the various characters along with their ascii values.
For the “special” keys, glut has predefined ascii codes. just go: case GLUT_KEY_UP:
instead of case whateverasciicode:
but this only works for the “special” keys.