TLFTextField KeyboardEvent.keyCode 13 not working?

Hi guys,

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


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.