# Key listeners

**URL:** <https://forum.kirupa.com/t/key-listeners/234556>\
**Category:** Uncategorized\
**Created:** [August 3, 2007, 10:04am UTC](https://forum.kirupa.com/t/key-listeners/234556 "2007-08-03T10:04:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![four4swords](https://avatars.discourse-cdn.com/v4/letter/f/87869e/32.png) [@four4swords](https://forum.kirupa.com/u/four4swords)\
**Post date:** [August 3, 2007, 10:04am UTC](https://forum.kirupa.com/t/key-listeners/234556/1 "2007-08-03T10:04:21Z")

</div>

hey,

I’m looking for an alternative to

```auto
on(keypress){} ..

```

I went tot this site… [http://flash-creations.com/notes/asclass\_key.php](http://flash-creations.com/notes/asclass_key.php)  
But this code will come into effect if the key is pressed… and **also** when it’s down…

How do i make it so that it only registers the key when it is pressed… but \*\*not \*\*when it is held down?

( so it’s like a one time thing only … also… this is for keyboard events… not the mouse events)

Thanks
