PDA

View Full Version : glut and keyboard



Eber Kain
07-05-2001, 12:12 PM
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?

dUckmAnn
07-05-2001, 12:21 PM
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).]

dallas
07-06-2001, 10:20 AM
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.

MrShoe
07-06-2001, 10:22 PM
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.