Repository navigation
feat: add Undo/Cut/Copy/Paste keycodes - #5591
Conversation
ReenigneArcher
left a comment
There was a problem hiding this comment.
Could you preserve whether the original packet contained the 0x8000 normalized-key prefix before applying this conversion?
SS_KBE_FLAG_NON_NORMALIZED alone does not distinguish these SDL scancodes from F11–F14. Moonlight Android can set that flag when keyboard-layout normalization is unavailable while still sending 0x8000 | VK_*. With the current ordering, 0x807A becomes 0x7A and is then converted from F11 to Undo; F12–F14 similarly become Cut/Copy/Paste.
Please either apply the 0x7A–0x7D aliases only when the original keycode did not contain 0x8000, or remove the ambiguous aliases and accept only the dedicated 0x0100–0x0103 values. A regression test should cover 0x807A–0x807D with SS_KBE_FLAG_NON_NORMALIZED.
When rebasing this PR, please preserve master’s current remapped-key release behavior.
06caa05 to
2eb3a59
Compare
2eb3a59 to
200a733
Compare
|
There was a problem hiding this comment.
The F11–F14 prefix handling and regression tests address the earlier finding. The editing-key feature is still absent from current master, but the disconnect cleanup needs the correction described inline.
GitHub confirms merge conflicts against master (d23354d). Please rebase and resolve them before merging, preserving the current extended-key release handling and libvirtualhid updates. The linked LizardByte/libvirtualhid PR #120 is also still open.
A focused MSYS2 UCRT64 gtest harness using the PR's keyboard functions reproduced 16 disconnect/remapping failures; removing the cleanup mask made all 32 cases pass. This used a recorder and stubbed scheduling, so it does not establish full Sunshine or Linux-device validation. Native CI, CodeQL, and lint await maintainer approval; the GH-Pages documentation check timed out waiting for those jobs.
The repository formatter also flags the new condition in src/input.cpp:1180 and the missing blank line after the local test struct in tests/unit/test_input.cpp:316. Please run uv run --locked lb-update-clang-format.
Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh
200a733 to
20c8190
Compare
|
Fixed. |
|
@TinfoilSubmarine LizardByte/libvirtualhid#120 is now merged. Please update Review completed by Codex | Model: gpt-6.1-sol | Thinking: xhigh |
20c8190 to
178974b
Compare
Map the non-normalized Undo/Cut/Copy/Paste keys (sent by clients as SDL scancodes 0x7A-0x7D or dedicated 0x0100-0x0103 values) to the native Linux editing keys via libvirtualhid. Only apply the scancode aliases when the original keycode lacked the 0x8000 normalized-key prefix so the F11-F14 virtual keys are not reinterpreted. Release held keys with their full 16-bit keycode when a client disconnects, so the editing keys are not left held after the stream ends.
178974b to
5574791
Compare
Bundle ReportBundle size has no change ✅ |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5591 +/- ##
==========================================
+ Coverage 49.36% 49.39% +0.03%
==========================================
Files 143 143
Lines 31302 31320 +18
Branches 13353 13362 +9
==========================================
+ Hits 15451 15471 +20
- Misses 13453 13771 +318
+ Partials 2398 2078 -320
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 30 files with indirect coverage changes Continue to review full report in Codecov by Harness.
|
Screenshot ComparisonPR #5591 screenshots vs Matrix:
|
9874dfa
into
SunshineStream:master























































































Description
Continuation of #5397 with libvirtualhid.
Add support for Undo/Cut/Copy/Paste keycodes (keyboard HID spec usage IDs 0x7A-0x7D). In order to do this I added some ad-hoc/bespoke keycodes in libvirtualhid.
Depends on LizardByte/libvirtualhid#120
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.