Android soft keyboard and back button.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Android soft keyboard and back button.

aaronyeo22
1. here clicks a textinput so it focuses and soft keyboard appears
2. user click back key on his phone - soft keyboard retracts (no backkeypressed event caught)
3. textinput still has the focus border around it (why?) and user clicks back key again - application goes in the background for a couple of seconds and closes itself.


protected function textinput1_keyDownHandler(event:KeyboardEvent):void
                        {
                                trace(event.keyCode);
                                if (event.keyCode == Keyboard.BACK) {
                                        trace("back!!");
                                        event.stopImmediatePropagation();
                                        event.preventDefault();
                                }
                        }

<s:TextInput  keyDown="textinput1_keyDownHandler(event)" />
Reply | Threaded
Open this post in threaded view
|

Re: Android soft keyboard and back button.

vincent
aaronyeo22 wrote
1. here clicks a textinput so it focuses and soft keyboard appears
2. user click back key on his phone - soft keyboard retracts (no backkeypressed event caught)
3. textinput still has the focus border around it (why?) and user clicks back key again - application goes in the background for a couple of seconds and closes itself.


protected function textinput1_keyDownHandler(event:KeyboardEvent):void
                        {
                                trace(event.keyCode);
                                if (event.keyCode == Keyboard.BACK) {
                                        trace("back!!");
                                        event.stopImmediatePropagation();
                                        event.preventDefault();
                                }
                        }

<s:TextInput  keyDown="textinput1_keyDownHandler(event)" />
Have the same issue here. I clear the TextInput focus by setting stage.focus to null when the softkeyboard deactivated as a workaround.