input-capture: switch-to-all is swallowed only when it needs Ctrl+Alt
QA finding 4: `ProcessHotKeys` never returns `false` for a matched `HotKeySwitch2AllPC` (`InputHook.cs:518-522`) — unlike every other hotkey branch it falls through, so a chord that does not itself hold Ctrl+Alt toggles ALL mode and still reaches the OS. `HotkeyMatch` grows `swallows`, true for every hotkey except that one when its configured chord requires neither Ctrl nor Alt; `handleKey` then queues the action and carries on encoding the key as an ordinary keystroke, which is what `ProcessHotKeys` returning `true` leaves to `KeyboardEvent` and `CallNextHookEx`. Documented in docs/protocol.md §4.5 and in the feature README, including the residual narrowing (Windows also requires the VK to land in the switch-machine range, `:611-620`). Unreachable today: the shortcut ships empty (`MouseWithoutBordersProperties.cs:30`) and an empty hotkey never matches (`Common.cs:127-129`). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
1 parent
09df9c09b2
commit
3626dde603
4 files changed
+43
-6
No files matched your search
@@ -112,6 +112,18 @@ code does not enforce is here.
|
||||
switch-machine is ignored when Shift or ⌘ is also held (`InputHook.cs:604-610`).
|
||||
Escape set (contracts C2): switch-machine naming the local slot while control
|
||||
is remote, and ⌃⌥⌘Escape, which is checked first so no veto can shadow it.
|
||||
**Switch-to-all is the one hotkey that is not always swallowed**: its branch
|
||||
in `ProcessHotKeys` (`InputHook.cs:518-522`) falls through instead of
|
||||
returning `false`, so on Windows a chord that does not itself hold Ctrl+Alt
|
||||
toggles ALL mode *and* reaches the OS. `HotkeyMatch.swallows` reproduces that:
|
||||
true unless `switchToAll` requires neither ⌃ nor ⌥, in which case the tap
|
||||
queues the action and then handles the key as an ordinary keystroke. app-shell
|
||||
inherits this the moment it exposes a hotkey editor — the shortcut ships empty
|
||||
(`MouseWithoutBordersProperties.cs:30`) and an empty hotkey never matches
|
||||
(`Common.cs:127-129`), so nothing reaches it today. Windows' own swallow is
|
||||
narrower still (the fall-through is caught only when the VK also lands in the
|
||||
switch-machine range, `:611-620`); the ⌃⌥ test is the honest approximation and
|
||||
the residual case is a hotkey editor's problem, not the wire's.
|
||||
- **Easy Mouse** (`EasyMouseOption.cs`, `InputHook.cs:467-473`): the tap pushes
|
||||
`.edgeCandidate(point:now:)` on moves only when the mode allows it — always
|
||||
for `Enable`, while ⌃ / ⇧ is held for those modes, never for `Disable` — and
|
||||
@@ -255,7 +267,9 @@ public final class EventTap: @unchecked Sendable {
|
||||
var unmappedKeyCount: UInt64 { get }
|
||||
static func now() -> TimeInterval // the lane's clock
|
||||
}
|
||||
public struct HotkeyMatch: Sendable, Equatable { var action: HotkeyAction; var routesLocal: Bool }
|
||||
public struct HotkeyMatch: Sendable, Equatable {
|
||||
var action: HotkeyAction; var routesLocal: Bool; var swallows: Bool
|
||||
}
|
||||
public struct HotkeyMatcher: Sendable {
|
||||
static let lockDoublePressWindow: TimeInterval // 0.5
|
||||
var config: HotkeyConfig
|
||||
|
||||
+6
-1
@@ -318,7 +318,12 @@ in relative mode (`Receiver.cs:156-170`).
|
||||
| `HotKeyExitMM` | 0 (disabled) | `Setting.cs:811-817` |
|
||||
|
||||
Hotkeys are ignored if Shift or Win is also held with Ctrl+Alt
|
||||
(`InputHook.cs:604-610`). Easy Mouse (`EasyMouseOption.cs`, default 1 =
|
||||
(`InputHook.cs:604-610`). Every matched hotkey is swallowed except
|
||||
`Switch2AllPCShortcut`: its branch (`InputHook.cs:518-522`) falls through
|
||||
instead of returning `false`, so with a chord that does not itself hold Ctrl+Alt
|
||||
the key toggles ALL mode *and* reaches the OS. Only reachable with a non-default
|
||||
setting — the shortcut ships empty (`MouseWithoutBordersProperties.cs:30`) and
|
||||
an empty hotkey never matches (`Common.cs:127-129`). Easy Mouse (`EasyMouseOption.cs`, default 1 =
|
||||
always): 0 disabled, 1 enabled, Ctrl/Shift variants require the modifier.
|
||||
|
||||
---
|
||||
|
||||
Reference in new issue
Block a user