Copy link to clipboard
Copied
Not sure if this is a bug or a simple feature change?
I noticed that the soft keyboard 'Enter' key returns keyCode '10' instead of the traditional '13' in AIR3.7 on Android (tested on a Nexus 4 & 7).
It means the hardcoded actionscript 'Keyboard.ENTER' no longer works for that button. For example, this won't catch the 'Enter' key:
_nameInput.addEventListener(KeyboardEvent.KEY_UP, keyUp);
private function keyUp(event:KeyboardEvent):void
{
// test for '13'
if (event.keyCode == Keyboard.ENTER)
{
// submitting form here etc
}
}
Instead, the Enter key will add a linebreak to the textfield.
My workaround is to detect both keycodes:
if (event.keyCode == Keyboard.ENTER || event.keyCode == 10)
Copy link to clipboard
Copied
Hi,
Could you please confirm the Enter key you are talking about. Is this the same as marked in red on the softkeyboard in the attached image.
Regards,
Nimit
Copy link to clipboard
Copied
Yes, that's the button I was talking about. Although I can see you're getting keyCode 13 when you try it. Here's what I see:
1. I bring up a login screen with 2 input textfields on (not stagetext, just normal single line input textfields). Then I tap on the username.
2. I get this alternative layout alongside the soft keyboard (maybe because my app is in landscape?). I enter username and tap the key marked in red.
3. The debug console traces this when I tap the key marked in red:
Key Event: [KeyboardEvent type="keyUp" bubbles=true cancelable=false eventPhase=2 charCode=10 keyCode=10 keyLocation=0 ctrlKey=false altKey=false shiftKey=false controlKey=false commandKey=false]
Incidentally, the 'Done' key does not trigger the keyboard event (but this is correct behaviour IMO, as it's not part of the keyboard). It might be nice to be able to capture it somehow though.
Copy link to clipboard
Copied
Would it be possible for you to share a sample project at nimitja@adobedotcom so that we may try reproduce this locally?
-Nimit