fix(gfn): align keyboard mapping with official client for non-US layouts - #547
Conversation
…d VKs from official GFN client Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_ff0cbfea-8c8c-46c7-97fc-ffade4bd0ae5) |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b306f60be0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 0x0042 => 0x77, | ||
| 0x0043 => 0x78, | ||
| 0x0044 => 0x79, | ||
| 0x0045 => 0x13, |
There was a problem hiding this comment.
Preserve NumLock instead of remapping raw 0x45 to Pause
In Windows native input capture, if NumLock comes from Raw Input as make_code 0x45 without RI_KEY_E0, normalize_scancode() leaves it as 0x0045; this new table then converts it to Pause (0x13) instead of preserving the incoming VK_NUMLOCK (0x90). That means native fullscreen sessions can send/toggle Pause when the user presses NumLock, so handle the 0x45 ambiguity with the fallback keycode or normalize NumLock to the existing E045 entry.
Useful? React with 👍 / 👎.
| 0x0073 => 0xC2, | ||
| 0x007D => 0xC1, | ||
| 0x007E => 0xBC, |
There was a problem hiding this comment.
Add native mappings for JP language keys
This international-key section covers JP IntlRo/IntlYen, but it skips the other physical JP 106 keys whose raw scancodes are 0x70 (Hiragana/Katakana), 0x79 (Henkan/Convert), and 0x7B (Muhenkan/NonConvert). In the native path those keys fall through to Windows fallback VKs while the renderer path added the official 0xE9/0xEA/0xEB codes in this commit, so Japanese-layout users get different behavior depending on whether native input capture is active.
Useful? React with 👍 / 👎.
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…uts (OpenCloudGaming#547) * Fix keyboard input for non-US layouts by using physical position-based VKs from official GFN client Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Fix native keyboard mapping edge cases Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This PR aligns OpenNOW keyboard input mapping with the official GFN web client to fix keypresses on non-US keyboard layouts.
Renderer (
opennow-stable/src/renderer/src/gfn/inputProtocol.ts):shouldUsePhysicalOemVirtualKeyandphysicalOemVirtualKeyCodeslogicNative (
native/opennow-streamer/src/input.rs,native/opennow-streamer/src/gstreamer_input.rs):layout_mapped_keyboard_keycodemapping Set 1 scancode → official position-dependent VKTests:
Note
Medium Risk
Touches all keyboard input encoding for GFN (renderer + native Windows); wrong VK tables would break typing on non-US layouts but scope is limited to mapping logic with added unit tests.
Overview
Aligns GFN keyboard packets with the official web client so non-US layouts (e.g. QWERTZ) send physical key-position virtual keys with scancode 0, instead of the browser’s layout-dependent
keyCode.Renderer (
inputProtocol.ts):virtualKeyFromEventnow prefersevent.code→ VK when available; the layout-aware OEM override (shouldUsePhysicalOemVirtualKey/physicalOemVirtualKeyCodes) is removed. Several code→VK entries are corrected or added (PrintScreen, IntlRo/Yen, OS keys, Japanese IME keys, numpad clear). Tests expect physical-code VKs on German punctuation and Y/Z swaps.Native streamer (
input.rs,gstreamer_input.rs): Windows key events run through newlayout_mapped_keyboard_keycode(Set 1 scancode → official position VK, fallback to OS keycode) while scancodes stay zeroed, mirroring the browser path.Reviewed by Cursor Bugbot for commit b306f60. Configure here.