Skip to main content
Participant
May 7, 2013
Question

How to keep the SoftKeyboard on mobile from closing after losing focus?

  • May 7, 2013
  • 1 reply
  • 656 views

Apple Use case:

In the iMessage application the user is able to enter text in an input and click a 'send' button. Clicking the send button keeps the softkeyboard open and the text is sent to the user.

My Adobe result, trying todo the samething.

The user clicks in a StageText instance, the softkeyboard raises, user can type. Once the user clicks a Button to send a message the softkeyboard closes and a

SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE fires.

This is a poor experience since each time I want to type a message the softkeyboard opens and closes after each send.

I have tried to give focus to the StageText instance after the button is clicked but this produces an even worse result as the keyboard begins closing and then opens again.

I have skimmed through the Apple documentation on Keyboard control and it suggests that this is obviously a possible use case (since iMessage uses it) using 'Responders'.

It seems I would have to create my own ANE to encapsulate this functionality. But I believe if Adobe wants to meet the strict usability guidelines Apple has in place this sort of stuff needs to be baked into AIR.

If you have any suggestions or workarounds please let me know

Thanks!

This topic has been closed for replies.

1 reply

May 8, 2013

Utterly tentative hunch (no time for a real test atm):

Have you tried to call

event.preventDefault()

in your handler ?

This works to block a lot of system-default-behaviors, like stop orientation change, focus etc.

b.bergerAuthor
Participant
May 8, 2013

I've tried to do that on the softKeyboardDeactivate event. But after reading the docs it states the following:

softKeyboardDeactivate event — dispatched when the virtual keyboard closes for any reason. This event cannot be canceled.

So, once StageText looses focus the OS automatically closes the softKeyboard with no way to keep it open except to never loose focus.