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;
}
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 https://libcinder.org/docs/classcinder_1_1app_1_1_key_event.html
sorry,
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;
38
cout << KeyEvent::KEY_q << endl;
113
…