Skip to main content
Inspiring
March 22, 2013
Question

text input for mobile device with hardware keyboard

  • March 22, 2013
  • 2 replies
  • 900 views

I have an application that will always run on a mobile device with a hardware keyboard. Is there a way to suppress the appearance of the soft keyboard with the TextInput class?

http://help.adobe.com/en_US/flex/mobileapps/WS82181550ec4a666a39bafe0312d9a274c00-8000.html#WS19f279b149e7481c-4cb7e4a013321c24dab-8000

"The text input controls always open the keyboard when receiving focus. They ignore the needsSoftKeyboard property, and setting it has no effect on the text input controls."

This suggestion for using the preventDefault for a SoftKeyboardEvent does not work.

http://www.peterelst.com/blog/2011/05/08/controlling-the-soft-keyboard-in-flex-mobile-applications/

Is the solution basically to not use the TextInput class and handle all of the hardware keyboard events manually with an alternative like a label?

This topic has been closed for replies.

2 replies

Mark.fromOP
Inspiring
March 24, 2013

You could have an arrow next to the text field and when the user clicks that you tell the app to enter the incoming text into a specific field, its a little weird but should avoid the keyboard popping up issue. Or instead of it being an arrow make your text field dynamic so you can give it an instance name, then place an invisible box over the top of it. When the user clicks that box you highlight the textbox so they know they are on the right field and then feed the keyboard input into the textbox.

Also maybe you can suppress the soft keyboard as soon as it pops up, so instead of it not popping up it does for a split second and you instantly call a function to hide it. Just some thoughts.

mmah-umdAuthor
Inspiring
March 25, 2013

I do not understand what you are suggesting in the first paragraph. Am I still entering text into a TextInput?

How do you suppress the soft keyboard?

From my first link, all I see is:

"To programmatically close the soft keyboard, set stage.focus to null. To close the soft keyboard and set focus to another control, set stage.focus to null, and then set the focus on the target control. You can also call another control’s requestSoftKeyboard() method to change focus and open the soft keyboard on another control."

This is not particularly helpful because now the keyboard input from the hardware keyboard will not be entered into the TextInput.

Also, I have tried capturing KeyboardEvents directly and writing the text to a Label, but there are significant problems when using the shift key. Multiple keystrokes for the same key are reported when they should not be, and keys report they are shifted when they should not be.