tags:

views:

324

answers:

1

Hi everyone!

I use OpenGL+GLUT for simple application, but I can't handle a "Tab" key press. Does anybody knows how to handle pressing of Tab key ?

thanx

P.S.:Mac OS 10.5.6, GCC 4.0

Solution

void processNormalKeys(unsigned char key, int x, int y){
    if ((int)key == 9) {
        //tab pressed
        ....
    }
....
}


....
int main(int argc, char ** argv) {
    ....
    glutKeyboardFunc(processNormalKeys);
    ....
}
+1  A: 

I believe hitting tab triggers the normal keyboard callback with a key value of 9 (ASCII for tab).

a.consciousness