When my focus is inside the input text field, pressing CTRL+ENTER works but ENTER does not.
Pressing Enter when my focus is anywhere BUT the input text field works just fine..
My intention is to detect if ENTER key was pressed after the user fills out the field, but it seems to only work for CTRL+ENTER
ActionScript 3:
// works:
stage.addEventListener(KeyboardEvent.KEY_DOWN, enterHandler);
// ignored:
email.addEventListener(KeyboardEvent.KEY_DOWN, enterHandler);
function enterHandler(event:KeyboardEvent):void{
if(event.keyCode == Keyboard.ENTER ){
email.text = 'Thanks!';
}
}
ENTER results in charCode == 0, whereas CTRL+ENTER is charCode == 13
email was created using the Text tool and set to "Editable"
Note: I am testing in Chrome and Firefox running Flash v10