You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Keyboard API and events parity between UWP and Windows App SDK
10
+
# Keyboard API and events parity between UWP and WinUI 3
11
11
12
12
The migration of apps from the Universal Windows Platform (UWP) to the Windows App SDK (specifically, WinUI 3) might require a few changes in the way input keyboard events are handled, primarily due to the app model differences. This topic describes commonly identified differences.
13
13
14
14
By using **UIElement**-specific WinUI 3 event handlers, and developing custom solutions for event routing, you can easily transition your apps to modern Windows applications.
15
15
16
-
## Mapping to Windows App SDK APIs for UWP APIs
16
+
## Mapping to WinUI 3 APIs from UWP APIs
17
17
18
18
### UWP APIs
19
19
@@ -24,17 +24,125 @@ In UWP, **CoreWindow** serves as the fundamental component attached directly to
24
24
***CharacterReceived**. Event raised when a new character is received by the input queue.
25
25
***CoreDispatcher.AcceleratorKeyActivated**. Event raised when an accelerator key is activated (either pressed or held down).
26
26
27
-
### Windows App SDK APIs (WinUI 3)
28
-
29
-
The Windows App SDK (WinUI 3) has a different concept from **CoreWindow**. Instead, WinUI 3 provides an input event handling mechanism using **Microsoft.Ui.Xaml.UIElement** (UIElement). Each class that inherits from **UIElement** can implement various keyboard or pointer events (which are also present in UWP's **CoreWindow**) such as **KeyUp**, **KeyDown**, **CharacterReceived**, and others. This approach allows event handling at the level of a specific UI control.
30
-
31
-
## UWP sample apps for keyboard events and KeyboardAccelerator
WinUI 3 (Windows App SDK) has a different concept from **CoreWindow**. Instead, WinUI 3 provides an input event handling mechanism using **Microsoft.Ui.Xaml.UIElement** (UIElement). Each class that inherits from **UIElement** can implement various keyboard or pointer events (which are also present in UWP's **CoreWindow**) such as **KeyUp**, **KeyDown**, **CharacterReceived**, and others. This approach allows event handling at the level of a specific UI control.
76
+
77
+
For detailed info about event handling, see [Keyboard events](/windows/apps/design/input/keyboard-events). You can associate keyboard events either XAML or in imperative source code. These examples demonstrate key event handling through code and accelerator key events in XAML.
0 commit comments