# Using the Keys in games...(TUT)

**URL:** <https://forum.kirupa.com/t/using-the-keys-in-games-tut/195818>\
**Category:** programming\
**Created:** [August 3, 2006, 12:44pm UTC](https://forum.kirupa.com/t/using-the-keys-in-games-tut/195818 "2006-08-03T12:44:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![denacioust](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@denacioust](https://forum.kirupa.com/u/denacioust)\
**Post date:** [August 3, 2006, 12:44pm UTC](https://forum.kirupa.com/t/using-the-keys-in-games-tut/195818/1 "2006-08-03T12:44:35Z")

</div>

Yeah…this is something that bugged me for ages trying the whole

> 

Key.isDown(Key.A)

So I learned how to use them and thought I’d help others out

```auto
Key.isDown(Key Code)

```

Is how you do it…but what are the codes? Well luckily theres a little bit of code thats fairly easily implemented to help you out there

```auto

var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
trace("The ASCII code for that key: "+Key.getAscii());
};
Key.addListener(keyListener);

```

Easy, huh?
