KeyCharacterMap.GetEvents(Char[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Get an array of KeyEvent objects that if put into the input stream could plausibly generate the provided sequence of characters.
[Android.Runtime.Register("getEvents", "([C)[Landroid/view/KeyEvent;", "GetGetEvents_arrayCHandler")]
public virtual Android.Views.KeyEvent[]? GetEvents (char[]? chars);
[<Android.Runtime.Register("getEvents", "([C)[Landroid/view/KeyEvent;", "GetGetEvents_arrayCHandler")>]
abstract member GetEvents : char[] -> Android.Views.KeyEvent[]
override this.GetEvents : char[] -> Android.Views.KeyEvent[]
Parameters
- chars
- Char[]
The sequence of characters to generate.
Returns
An array of KeyEvent
objects, or null if the given char array
can not be generated using the current key character map.
- Attributes
Remarks
Get an array of KeyEvent objects that if put into the input stream could plausibly generate the provided sequence of characters. It is not guaranteed that the sequence is the only way to generate these events or that it is optimal.
This function is primarily offered for instrumentation and testing purposes. It may fail to map characters to key codes. In particular, the key character map for the #BUILT_IN_KEYBOARD built-in keyboard
device id may be empty. Consider using the key character map associated with the #VIRTUAL_KEYBOARD virtual keyboard
device id instead.
For robust text entry, do not use this function. Instead construct a KeyEvent
with action code KeyEvent#ACTION_MULTIPLE
that contains the desired string using KeyEvent#KeyEvent(long, String, int, int)
.
Java documentation for android.view.KeyCharacterMap.getEvents(char[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.