# How do i capture the left, right, up, down keys?

**URL:** <https://forum.kirupa.com/t/how-do-i-capture-the-left-right-up-down-keys/224533>\
**Category:** flash\
**Created:** [May 3, 2007, 3:20am UTC](https://forum.kirupa.com/t/how-do-i-capture-the-left-right-up-down-keys/224533 "2007-05-03T03:20:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eudora](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@eudora](https://forum.kirupa.com/u/eudora)\
**Post date:** [May 3, 2007, 3:20am UTC](https://forum.kirupa.com/t/how-do-i-capture-the-left-right-up-down-keys/224533/1 "2007-05-03T03:20:08Z")

</div>

Using the example and help in the Flash, I trace the KEY\_DOWN state…

```php
 trace("Key Pressed: " + String.fromCharCode(event.charCode) + " (key code: " + event.keyCode + " character code: " + event.charCode + ")");

```

It prints out nothing for the direction keys… am I missing some steps?

Ah… the String.fromCharCode is stopping the rest of the trace for some reason… found it in the keyCode…
