# This.onKeyDown isn't triggered by enter

**URL:** <https://forum.kirupa.com/t/this-onkeydown-isnt-triggered-by-enter/33290>\
**Category:** Uncategorized\
**Created:** [October 17, 2003, 1:27pm UTC](https://forum.kirupa.com/t/this-onkeydown-isnt-triggered-by-enter/33290 "2003-10-17T13:27:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m\_andrews808](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@m\_andrews808](https://forum.kirupa.com/u/m_andrews808)\
**Post date:** [October 17, 2003, 1:27pm UTC](https://forum.kirupa.com/t/this-onkeydown-isnt-triggered-by-enter/33290/1 "2003-10-17T13:27:37Z")

</div>

I’ve this in my code:

```auto

Key.addListener(this);

this.onKeyDown = function() {
      trace(Key.getCode());
}

```

which works okay but it dosn’t seem to be triggered when I press the enter key (either the main one or the one on the num pad)

anyone know an event I can use where I can capture an Enter key press? I know you can use on(keyPress “\<Enter\>”) in a button but I’d like somethin I can use in the MX style of coding

cheers all (-:
