[This documentation is preliminary and is subject to change.]
Occurs when a keyboard key is released while the UIElement has focus.
Syntax
<uiElement KeyUp="eventhandler"/>
Event information
| Delegate | KeyEventHandler |
|---|
Remarks
Controls in your UI generate keyboard events only when they have input focus. An individual control gains focus when the user clicks or taps directly on that control in the layout, or uses the Tab key to step into a tab sequence within the content area. You can also focus controls programmatically by calling Control.Focus.
For more info on handling keyboard events, including example code for defining a KeyEventHandler method, see Responding to keyboard input.
Specific Windows Runtime controls may have class-based handling for the KeyUp input event. If so, the control probably has an override for the method OnKeyUp. Typically these class handlers are intended to process a subset of key presses that enable a keyboard-based user interaction with that control, and often this interaction supports a keyboard accessibility feature. If a key press is handled by class-based handling, then the key press is considered to be already handled, and the KeyUp event is not raised for handling by any user code handlers on that control. For more info on how class-based handling for events works, see Input event handlers in controls.
One scenario for handling keyboard events is to support access keys or accelerator keys for an app, or a region or control within an app. For more info about this scenario, see Implementing keyboard accessibility.
This event is a routed event. For more info on the routed event concept, see Events and routed events overview.
This event also supports the ability to attach event handlers to the route that will be invoked even if the event data for the event is marked Handled. See AddHandler.
Requirements
|
Minimum supported client | Windows 8 Release Preview |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
- UIElement
- KeyDown
- GotFocus
- OnKeyUp
- Responding to keyboard input
- Events and routed events overview
- XAML user input events sample
Build date: 5/22/2012
