Sdílet prostřednictvím


KeyEvent.KeyCodeFromString(String) Method

Definition

Gets a keycode by its symbolic name such as "KEYCODE_A" or an equivalent numeric constant such as "29".

[Android.Runtime.Register("keyCodeFromString", "(Ljava/lang/String;)I", "")]
public static Android.Views.Keycode KeyCodeFromString (string symbolicName);
[<Android.Runtime.Register("keyCodeFromString", "(Ljava/lang/String;)I", "")>]
static member KeyCodeFromString : string -> Android.Views.Keycode

Parameters

symbolicName
String

The symbolic name of the keycode.

Returns

The keycode or #KEYCODE_UNKNOWN if not found.

Attributes

Remarks

Gets a keycode by its symbolic name such as "KEYCODE_A" or an equivalent numeric constant such as "29". For symbolic names, starting in android.os.Build.VERSION_CODES#Q the prefix "KEYCODE_" is optional.

Java documentation for android.view.KeyEvent.keyCodeFromString(java.lang.String).

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.

Applies to