Domanda

Io uso OpenGL + GLUT per semplice applicazione, ma non riesco a gestire un "Tab" premere il tasto. Fa qualcuno sa come gestire la pressione del tasto Tab?

Grazie

P.S.:Mac OS 10.5.6, GCC 4.0

Soluzione

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


....
int main(int argc, char ** argv) {
    ....
    glutKeyboardFunc(processNormalKeys);
    ....
}
È stato utile?

Soluzione

scheda

Credo che colpisce innesca la normale callback tastiera con un valore di chiave di 9 (ASCII per scheda).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top