Commit 151a43c
authored
修复远程桌面软件按 modifier key 时产生幽灵 'a' 按键的问题 (#1116)
* Fix ghost 'a' keypress from remote desktop modifier key events
Some remote desktop software (e.g. Parsec, older Deskflow) sends
flagsChanged events via IOHIDPostEvent without setting
event.key.keyCode for modifier keys, causing it to default to 0
(kVK_ANSI_A). The osxKeycodeToRime function then maps keycode 0
to XK_a via additionalCodeMappings, producing a ghost 'a' keypress
whenever Shift, CapsLock, or other modifier keys are pressed.
This fix validates that event.keyCode corresponds to a known modifier
virtual keycode for flagsChanged events. When an invalid keycode is
detected (such as 0), the correct modifier keycode is inferred from
the changed modifier flags instead.
Fixes #8251 parent 4be026f commit 151a43c
2 files changed
Lines changed: 40 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
68 | 92 | | |
69 | 93 | | |
70 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
67 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
68 | 81 | | |
69 | 82 | | |
70 | 83 | | |
| |||
0 commit comments