When you connect to the Android device for debugging, you will find that the data cannot be normally input because no keyboard pops up. In this case, you need a new class: touchscreenkeyboard to bring up the keyboard.
Official Website instructions: touchscreenkeyboard
To put it simply, it is to solve the problem of on-screen keyboard and keyboard access for iPhone and Android.
This interface allows you to display different types of keyboards: ASCII, numbers, URLs, emails, and others.
Because the appearance of the keyboard may mask the user interface and whether the user interface is blocked is set by you.
Touchscreenkeyboard. Visible and touchscreenkeyboard. area should be used to determine whether the keyboard is displayed (activated) and which part of the screen is used.
Apple's API does not allow explicit direction keyboards.
Therefore, you can define your own settings if the keyboard needs to be automatically rotated to match a specific positioning device.
Related variables:
Text |
Returns the text displayed by the input field of the keyboard. This |
Active |
Specifies if the keyboard is visible or is sliding into the position on |
Done |
Specifies if input process was finished (read only) |
Wascanceled |
Specifies if input process was canceled (read only) |
Class variables:
Hideinput |
Specifies if text input field above the keyboard will be hidden when |
Autorotatetoportrait |
Specifies whether the keyboard shocould be automatically rotated |
Autorotatetoportraitupsidedown |
Specifies whether the keyboard shocould be automatically rotated |
Autorotatetolandscapeleft |
Specifies whether the keyboard shocould be automatically rotated |
Autorotatetolandscaperight |
Specifies whether the keyboard shocould be automatically rotated |
Area |
Returns portion of the screen which is covered by the keyboard. Returns |
Visible |
Returns true whenever any keyboard is completely visible on the screen. |
There is also a class method:
Open: opens the native keyboard provided by OS on the screen.
Make a slight modification in the previous Code and add a variable to determine whether a name needs to be entered,
private var keyboard : TouchScreenKeyboard ;private var enterName : boolean = false;
Call the touchscreenkeyboard open method to open the keyboard:
if (!enterName) {keyboard = TouchScreenKeyboard.Open(newName);enterName = true;}if (keyboard){newName = keyboard.text;}
Then, you will find that the Android device can be entered: