KeyEventArgs Class

Provides information specific to a keyboard event.

Definition

Namespace: Avalonia.Input
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public class KeyEventArgs : RoutedEventArgs
Inheritance
Object    EventArgs    RoutedEventArgs    KeyEventArgs

Properties

Handled Gets or sets a value indicating whether the routed event has already been handled.
(Inherited from RoutedEventArgs)
Key

Gets the virtual-key for the associated event.
A given physical key can result in different virtual keys depending on the current keyboard layout.
This is the key that is generally referred to when creating keyboard shortcuts.

For example, when pressing the key located at the Z position on standard US English QWERTY keyboard, this property returns:
- Z for an English (QWERTY) layout
- W for a French (AZERTY) layout
- Y for a German (QWERTZ) layout
- Z for a Russian (JCUKEN) layout

KeyDeviceType Type of the device that fire the event
KeyModifiers Gets the key modifiers for the associated event.
KeySymbol

Gets the unicode symbol of the key, or null if none is applicable.

For example, when pressing the key located at the Z position on standard US English QWERTY keyboard, this property returns:
- z for an English (QWERTY) layout
- w for a French (AZERTY) layout
- y for a German (QWERTZ) layout
- я for a Russian (JCUKEN) layout

PhysicalKey

Gets the physical key for the associated event.

This value is independent of the current keyboard layout and usually correspond to the key printed on a standard US English QWERTY keyboard.

Route Gets or sets the routing strategy (direct, bubbling, or tunneling) of the routed event.
(Inherited from RoutedEventArgs)
RoutedEvent Gets or sets the routed event associated with these event args.
(Inherited from RoutedEventArgs)
Source Gets or sets the source object that raised the routed event.
(Inherited from RoutedEventArgs)

Methods

Equals(Object)Determines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also