Question

J'utilise OpenGL + GLUT pour une application simple, mais je ne peux pas gérer une pression de touche « Tab ». Est-ce que quelqu'un sait comment manipuler pression de touche Tab?

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);
    ....
}
Était-ce utile?

La solution

Je crois onglet frapper déclenche le rappel du clavier normal avec une valeur de clé de 9 (ASCII onglet).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top