Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
KeyRoutedEventArgs Class
Definition
- Namespace:
- Microsoft.UI.Xaml.Input
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.
public ref class KeyRoutedEventArgs sealed : RoutedEventArgs
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class KeyRoutedEventArgs final : RoutedEventArgs
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class KeyRoutedEventArgs : RoutedEventArgs
Public NotInheritable Class KeyRoutedEventArgs
Inherits RoutedEventArgs
- Inheritance
- Attributes
Remarks
Button input is mapped to different key values for various devices, including game controllers.
This table provides the mapping detail for a game controller.
| Button | Key value | OriginalKey value |
|---|---|---|
| π GamepadA button | Space | GamepadA or NavigationAccept |
| π GamepadB button | Escape | GamepadB or NavigationCancel |
| π GamepadX button | GamepadX | GamepadX |
| π GamepadY button | GamepadY | GamepadY |
| π GamepadDPad button 50 | GamepadDPadUp/Down/Left/Right | GamepadDPadUp/Down/Left/Right or NavigationUp/Down/Left/Right |
| π GamePad Joystick/Thumbstick | GamepadLeftThumbstickButton/Up/Down/Left/Right or GamepadRightThumbstickButton/Up/Down/Left/Right | GamepadLeftThumbstickButton/Up/Down/Left/Right or GamepadRightThumbstickButton/Up/Down/Left/Right or NavigationUp/Down/Left/Right |
| π Gamepad Trigger | GamePadRightTrigger/LeftTrigger | GamePadRightTrigger/LeftTrigger |
| π Gamepad Bumper/Shoulder | GamePadRightShoulder/LeftShoulder | GamePadRightShoulder/LeftShoulder |
| π Gamepad Menu button | GamepadMenu | GamepadMenu or NavigationMenu |
| π Gamepad View button | GamepadView | GamepadView or NavigationView |
Properties
| Name | Description |
|---|---|
| DeviceId |
Gets a unique ID for the input device that generated this key event (not supported for all input devices). |
| Handled |
Gets or sets a value that marks the routed event as handled. A |
| Key |
Gets the virtual-key associated with the event. Depending on the input device, this can be a mapped value. For raw, unmapped event data, see the OriginalKey property. |
| KeyStatus |
Gets a structure value that reports various system-detected characteristics of the key press, including repeat count and menu status. |
| OriginalKey |
Gets the original, unmapped virtual-key associated with the event. Depending on the input device, the input button might be mapped to a different key value. For the mapped event value, see the Key property. |
| OriginalSource |
Gets a reference to the object that raised the event. This is often a template part of a control rather than an element that was declared in your app UI. (Inherited from RoutedEventArgs) |
Applies to
See also
Feedback
Was this page helpful?
