KeyEvent Class
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.
Object used to report key and button events.
[Android.Runtime.Register("android/view/KeyEvent", DoNotGenerateAcw=true)]
public class KeyEvent : Android.Views.InputEvent, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/view/KeyEvent", DoNotGenerateAcw=true)>]
type KeyEvent = class
inherit InputEvent
interface IParcelable
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- Inheritance
- Attributes
- Implements
Remarks
Java documentation for android.view.KeyEvent.
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.
Constructors
Fields
| MaxKeycode |
Properties
| Action |
Retrieve the action of this key event. |
| Characters |
Obsolete.
For the special case of a |
| Class |
Returns the runtime class of this |
| Creator | |
| Device |
Gets the device that this event came from. (Inherited from InputEvent) |
| DeviceId |
To be added |
| DisplayLabel |
Gets the primary character for this key. |
| DownTime |
Retrieve the time of the most recent key down event,
in the |
| EventTime |
Retrieve the time this event occurred,
in the |
| Flags |
Returns the flags for this key event. |
| Handle |
The handle to the underlying Android instance. (Inherited from Object) |
| HasNoModifiers |
Returns true if no modifier keys are pressed. |
| IsAltPressed |
Returns the pressed state of the ALT meta key. |
| IsCanceled |
For |
| IsCapsLockOn |
Returns the locked state of the CAPS LOCK meta key. |
| IsCtrlPressed |
Returns the pressed state of the CTRL meta key. |
| IsFunctionPressed |
Returns the pressed state of the FUNCTION meta key. |
| IsLongPress |
For |
| IsMetaPressed |
Returns the pressed state of the META meta key. |
| IsNumLockOn |
Returns the locked state of the NUM LOCK meta key. |
| IsPrintingKey |
Returns true if this key produces a glyph. |
| IsScrollLockOn |
Returns the locked state of the SCROLL LOCK meta key. |
| IsShiftPressed |
Returns the pressed state of the SHIFT meta key. |
| IsSymPressed |
Returns the pressed state of the SYM meta key. |
| IsSystem |
Is this a system key? System keys can not be used for menu shortcuts. |
| IsTracking |
For |
| JniIdentityHashCode | (Inherited from Object) |
| JniPeerMembers | |
| KeyCharacterMap |
Gets the KeyCharacterMap associated with the keyboard device. |
| KeyCode |
Retrieve the key code of the key event. |
| MaxKeyCode |
Returns the maximum keycode. |
| MetaState |
Returns the state of the meta keys. |
| ModifierMetaStateMask |
Gets a mask that includes all valid modifier key meta state bits. |
| Modifiers |
Returns the state of the modifier keys. |
| Number |
Gets the number or symbol associated with the key. |
| PeerReference | (Inherited from Object) |
| RepeatCount |
Retrieve the repeat count of the event. |
| ScanCode |
Retrieve the hardware key id of this key event. |
| Source |
To be added |
| ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
| ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. |
| UnicodeChar |
Gets the Unicode character generated by the specified key and meta key state combination. |
Methods
| ChangeAction(KeyEvent, KeyEventActions) |
Create a new key event that is the same as the given one, but whose action is replaced with the given value. |
| ChangeFlags(KeyEvent, KeyEventFlags) |
Create a new key event that is the same as the given one, but whose flags are replaced with the given value. |
| ChangeTimeRepeat(KeyEvent, Int64, Int32) |
Create a new key event that is the same as the given one, but whose event time and repeat count are replaced with the given value. |
| ChangeTimeRepeat(KeyEvent, Int64, Int32, KeyEventFlags) |
Create a new key event that is the same as the given one, but whose event time and repeat count are replaced with the given value. |
| Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
| DescribeContents() |
Describe the kinds of special objects contained in this Parcelable's marshalled representation. (Inherited from InputEvent) |
| Dispatch(KeyEvent+ICallback) | |
| Dispatch(KeyEvent+ICallback, KeyEvent+DispatcherState, Object) |
Deliver this key event to a KeyEvent Callback interface. |
| Dispose() | (Inherited from Object) |
| Dispose(Boolean) | (Inherited from Object) |
| Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
| GetDeadChar(Int32, Int32) |
Get the character that is produced by putting accent on the character c. |
| GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
| GetKeyData(KeyCharacterMap+KeyData) |
Obsolete.
Get the character conversion data for a given key code. |
| GetMatch(Char[]) |
Gets the first character in the character array that can be generated by the specified key code. |
| GetMatch(Char[], Int32) | |
| GetMatch(Char[], MetaKeyStates) |
Gets the first character in the character array that can be generated by the specified key code. |
| GetUnicodeChar(Int32) | |
| GetUnicodeChar(MetaKeyStates) |
Gets the Unicode character generated by the specified key and meta key state combination. |
| HasModifiers(MetaKeyStates) |
Returns true if only the specified modifiers keys are pressed. |
| IsFromSource(InputSourceType) |
Determines whether the event is from the given source. (Inherited from InputEvent) |
| IsGamepadButton(Keycode) |
Returns true if the specified keycode is a gamepad button. |
| IsMediaSessionKey(Int32) |
Returns whether this key will be sent to the
|
| IsModifierKey(Keycode) |
Returns true if this key code is a modifier key. |
| JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
| KeyCodeFromString(String) |
Gets a keycode by its symbolic name such as "KEYCODE_A" or an equivalent numeric constant such as "29". |
| KeyCodeToString(Keycode) |
Returns a string that represents the symbolic name of the specified keycode such as "KEYCODE_A", "KEYCODE_DPAD_UP", or an equivalent numeric constant such as "1001" if unknown. |
| MetaStateHasModifiers(MetaKeyStates, MetaKeyStates) |
Returns true if only the specified modifier keys are pressed according to the specified meta state. |
| MetaStateHasNoModifiers(MetaKeyStates) |
Returns true if no modifiers keys are pressed according to the specified meta state. |
| NormalizeMetaState(MetaKeyStates) |
Normalizes the specified meta state. |
| Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
| NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
| SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
| SetSource(InputSourceType) |
To be added |
| StartTracking() |
Call this during |
| ToArray<T>() | (Inherited from Object) |
| ToString() |
Returns a string representation of the object. (Inherited from Object) |
| UnregisterFromRuntime() | (Inherited from Object) |
| Wait() |
Causes the current thread to wait until another thread invokes the
|
| Wait(Int64) |
Causes the current thread to wait until either another thread invokes the
|
| Wait(Int64, Int32) |
Causes the current thread to wait until another thread invokes the
|
| WriteToParcel(Parcel, ParcelableWriteFlags) |
Flatten this object in to a Parcel. |
Explicit Interface Implementations
| IJavaPeerable.Disposed() | (Inherited from Object) |
| IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
| IJavaPeerable.Finalized() | (Inherited from Object) |
| IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
| IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
| IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
| IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
| JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
| JavaCast<TResult>(IJavaObject) | |
| GetJniTypeName(IJavaPeerable) | |