# Keyboard input (non qwerty)

**URL:** <https://discourse.libcinder.org/t/keyboard-input-non-qwerty/1010>\
**Category:** Using Cinder\
**Created:** [January 2, 2018, 7:13pm UTC](https://discourse.libcinder.org/t/keyboard-input-non-qwerty/1010 "2018-01-02T19:13:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincent\_rioux](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vincent\_rioux](https://discourse.libcinder.org/u/vincent_rioux)\
**Post date:** [January 2, 2018, 7:13pm UTC](https://discourse.libcinder.org/t/keyboard-input-non-qwerty/1010/1 "2018-01-02T19:13:18Z")

</div>

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;  
}

---

<div class="post-metadata">

**Author:** ![benjaminbojko](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/benjaminbojko/32/591_2.png) [@benjaminbojko](https://discourse.libcinder.org/u/benjaminbojko)\
**Post date:** [January 2, 2018, 7:17pm UTC](https://discourse.libcinder.org/t/keyboard-input-non-qwerty/1010/2 "2018-01-02T19:17:54Z")

</div>

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](https://libcinder.org/docs/classcinder_1_1app_1_1_key_event.html)

---

<div class="post-metadata">

**Author:** ![vincent\_rioux](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vincent\_rioux](https://discourse.libcinder.org/u/vincent_rioux)\
**Post date:** [January 2, 2018, 7:32pm UTC](https://discourse.libcinder.org/t/keyboard-input-non-qwerty/1010/3 "2018-01-02T19:32:14Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![balachandran\_c](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@balachandran\_c](https://discourse.libcinder.org/u/balachandran_c)\
**Post date:** [January 2, 2018, 8:02pm UTC](https://discourse.libcinder.org/t/keyboard-input-non-qwerty/1010/4 "2018-01-02T20:02:35Z")

</div>

You can try using `event.getNativeKeyCode()` ?

---

<div class="post-metadata">

**Author:** ![vincent\_rioux](https://avatars.discourse-cdn.com/v4/letter/v/bc79bd/32.png) [@vincent\_rioux](https://discourse.libcinder.org/u/vincent_rioux)\
**Post date:** [January 2, 2018, 8:17pm UTC](https://discourse.libcinder.org/t/keyboard-input-non-qwerty/1010/5 "2018-01-02T20:17:25Z")

</div>

when ‘q’ letter pressed :

cout \<\< event.getNativeKeyCode() \<\< endl;  
38  
cout \<\< KeyEvent::KEY\_q \<\< endl;  
113

…
