修复 UWP 应用收不到侧键触发的复制粘贴#226
Open
zeward-lee wants to merge 1 commit into
Open
Conversation
zeward-lee
commented
Jul 4, 2026
core/key_simulator.py 的 _make_key_input 原本只填虚拟键码 wVk,没填扫描码 wScan(默认 0)。SendInput 发出的键盘事件因此缺少扫描码,UWP 应用(如 hills 播放器)的输入栈会丢弃这种没有扫描码的合成键盘事件,导致侧键映射的 copy/paste(Ctrl+C/V)在 UWP 应用里失效,普通桌面应用正常。新增 _vk_to_scan 辅助函数(惰性绑定 user32.MapVirtualKeyW,避开单元测试 fake_windll 只 mock SendInput 的限制),_make_key_input 填入 wScan。wVk 与 wScan 同时填写,普通桌面应用和 UWP/Chromium 等都能收到完整键盘消息。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.