# TLFTextField KeyboardEvent.keyCode 13 not working?

**URL:** <https://forum.kirupa.com/t/tlftextfield-keyboardevent-keycode-13-not-working/312669>\
**Category:** flash\
**Created:** [August 10, 2010, 8:26am UTC](https://forum.kirupa.com/t/tlftextfield-keyboardevent-keycode-13-not-working/312669 "2010-08-10T08:26:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swooter](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@Swooter](https://forum.kirupa.com/u/Swooter)\
**Post date:** [August 10, 2010, 8:26am UTC](https://forum.kirupa.com/t/tlftextfield-keyboardevent-keycode-13-not-working/312669/1 "2010-08-10T08:26:14Z")

</div>

Hi guys,

I’m trying to catch Return key presses in a TLF textfield, but the code I’m using is not working:

```auto

function keyHandler(e:KeyboardEvent):void {
  trace(e.keyCode == 13); // true/false
}

myTextField.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
myTextField.addEventListener(KeyboardEvent.KEY_UP, keyHandler);

```

Any thoughts why this is not working? It does work when using a regular (classic) textfield, but I need it to be TLF.
