KeyEventArgs Class
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Provides event data for the UIElement::KeyUp and UIElement::KeyDown events.
Assembly: System.Windows (in System.Windows.dll)
The KeyEventArgs type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | 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. |
![]() | Key | Gets the keyboard key associated with the event. |
![]() | OriginalSource | Gets a reference to the object that raised the event. (Inherited from RoutedEventArgs.) |
![]() | PlatformKeyCode | Gets an integer value that represents the key that is pressed or released (depending on which event is raised). This value is the nonportable key code, which is operating system–specific. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
Key events can be handled by user code. They can also be potentially handled by controls through virtual method overrides, such that user code does not receive specific key events. Also, a browser-hosted application has all key events initially processed by the browser host, which might suppress certain key codes or combinations that the browser host reserves.


