# getCharCode and non-character keys

**URL:** <https://forum.kirupa.com/t/getcharcode-and-non-character-keys/292925>\
**Category:** flash\
**Created:** [July 20, 2009, 11:59pm UTC](https://forum.kirupa.com/t/getcharcode-and-non-character-keys/292925 "2009-07-20T23:59:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tekkan](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Tekkan](https://forum.kirupa.com/u/Tekkan)\
**Post date:** [July 20, 2009, 11:59pm UTC](https://forum.kirupa.com/t/getcharcode-and-non-character-keys/292925/1 "2009-07-20T23:59:16Z")

</div>

String.fromCharCode works for converting the keycodes into the character on the keyboard that they represent, but it does not work with all the keys.

If the keys I am using are A,B,C,D,etc this function works, but if they are Keyboard.LEFT, Keyboard.ENTER, Keyboard.SHIFT, etc, fromCharCode doesnt return anything with these key codes.

This website:  
[http://www.signar.se/blog/as-3-charcodes/](http://www.signar.se/blog/as-3-charcodes/)  
apparently shows that these keys (like SHIFT, ENTER) have no char code, just a key code.

There must be some way to convert these non-character key codes into strings that say what the key was, right?
