Repository navigation
fix: VirtualKeyHelper OEM mappings - #23233
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes cross-platform mappings for OEM (punctuation-row) keys so they map to the correct Win32 VK_OEM_* virtual key codes instead of keypad-specific keys (e.g., Decimal, Subtract) or None. It also adds WASM Skia runtime tests to prevent regressions in the browser keyboard ingress and BrowserVirtualKeyHelper.FromCode.
Changes:
- Update iOS (UIKit) and Android keycode mappings to return
VirtualKeyHelper.Oem*values for OEM-row keys. - Extend browser (
event.code) mapping to cover OEM-row physical keys (shift-independent) and add regression tests. - Enable OEM-row mappings on Linux FrameBuffer and Skia X11 paths using
VirtualKeyHelper.Oem*.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UWP/System/VirtualKeyHelper.UIKit.cs | Remaps UIKit HID usages for punctuation/OEM keys to VirtualKeyHelper.Oem* constants. |
| src/Uno.UWP/System/VirtualKeyHelper.Android.cs | Remaps Android Keycode OEM-row keys to VirtualKeyHelper.Oem* constants. |
| src/Uno.UWP/System/BrowserVirtualKeyHelper.cs | Adds event.code OEM-row mappings to Win32 VK_OEM_* values; clarifies unmapped fall-through behavior. |
| src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_BrowserKeyboardInputSource.cs | Adds SkiaWasm runtime test covering end-to-end OnNativeKeyboardEvent -> KeyDown virtual key mapping and modifier propagation. |
| src/Uno.UI.RuntimeTests/Tests/Windows_System/Given_BrowserVirtualKeyHelper.cs | Adds runtime test coverage for BrowserVirtualKeyHelper.FromCode OEM-row mappings. |
| src/Uno.UI.Runtime.Skia.X11/X11_Bindings/x11bindings_X11KeyTransform.cs | Enables X11 OEM-row mappings using VirtualKeyHelper.Oem*. |
| src/Uno.UI.Runtime.Skia.Linux.FrameBuffer/Devices/Input/FrameBufferKeyboardInputSource.cs | Maps Linux input OEM-row keys to VirtualKeyHelper.Oem* (and VK_OEM_102). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23233/wasm-skia-net9/index.html |
|
The build 211725 found UI Test snapshots differences: Details
|
|
Shouldn't similar mapping also be done on Win32? |
|
@MartinZikmund Win32 already emits the proper VK_OEM_* virtual key codes for these keys which we cast directly, I think we shouldn't need additional remapping there like we do on Wasm/iOS/Android/X11 paths where the platform key abstractions differ. |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-23233/wasm-skia-net9/index.html |
|
The build 211764 found UI Test snapshots differences: Details
|
GitHub Issue: closes https://github.com/unoplatform/kahua-private/issues/472
PR Type:
🐞 Bugfix
What changed? 🚀
PR Checklist ✅
Screenshots Compare Test Runresults.