Keyboard input (non qwerty)

Is there a way to get the proper char/code out of a non-qwerty keyboard?

void keyDown( KeyEvent event ) {
if( event.getChar() == ‘a’ ) cout << “pressed q on an azerty keyboard” << endl;

You can probably use event.getCode() and compare it to the KEY_ enum. See


void keyDown( KeyEvent event ) {
if ( event.getCode() == KeyEvent::KEY_q ) quit();

makes the same result, key pressed needs to be ‘a’ (on an azerty keyboard)

You can try using event.getNativeKeyCode() ?

when ‘q’ letter pressed :

cout << event.getNativeKeyCode() << endl;
cout << KeyEvent::KEY_q << endl;