Show / Hide Table of Contents

Class KeyEventArgs

Provides data for the KeyUp and KeyDown routed events, as well as related attached and Preview events.

Inheritance
System.Object
System.EventArgs
RoutedEventArgs
KeyEventArgs
Inherited Members
RoutedEventArgs.OriginalSource
System.EventArgs.Empty
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Input
Assembly: OpenSilver.dll
Syntax
public sealed class KeyEventArgs : RoutedEventArgs

Properties

| Improve this Doc View Source

Cancellable

Gets or sets a value that determines if the routed event will call preventDefault() if Handled is set to true. The default is true.

Declaration
public bool Cancellable { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along the event route from handling the same event again.

Declaration
public bool Handled { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Key

Gets the keyboard key associated with the event.

Declaration
public Key Key { get; }
Property Value
Type Description
Key
| Improve this Doc View Source

KeyModifiers

Gets a value that indicates which key modifiers were active at the time that the pointer event was initiated.

Declaration
public ModifierKeys KeyModifiers { get; }
Property Value
Type Description
ModifierKeys
| Improve this Doc View Source

PlatformKeyCode

Gets an integer value that represents the key that is pressed or released (depending on which event is raised). This value is browser-specific.

Declaration
public int PlatformKeyCode { get; }
Property Value
Type Description
System.Int32
  • Improve this Doc
  • View Source