In most cases, simply giving focus to a text input field will invoke the virtual keyboard. Losing focus will dismiss the virtual keyboard. Perhaps we require our application to do this without user interaction, or immediately when entering a certain application state for convenience.
We configure a Shape
to toggle the Android virtual keyboard on and off through a Tap
touch event assigned to it.
1. First, import the following classes into your project:
import flash.display.Sprite; import flash.display.Stage; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.SoftKeyboardEvent; import flash.events.TouchEvent; import flash.text.TextField; import flash.text.TextFormat; import flash.ui.Multitouch; import flash.ui.MultitouchInputMode;
2. Declare a
Shape
alongside aTextField
andTextFormat
object. These will be used for interaction and visual feedback.private var tapBox:Sprite; private var tapBoxField...