input-inject: record why the lock hotkey's desktop gate is N/A (QA finding 2)

Windows wraps the `HotKeyLockMachine` branch in
`if (!Common.RunOnLogonDesktop && !Common.RunOnScrSaverDesktop)`
(`InputSimulation.cs:408-409`); `KeyState.processDown` has no such
guard, and nothing said whether that was considered or missed.

Both flags are set only where the MWB service launches a second copy of
the process onto the `Winlogon` or `Screen-saver` secure desktop
(`Program.cs:150-167`, `Common.cs:176-186`). macOS has no secure-desktop
session split, no copy of us behind `loginwindow` or the screen saver,
and a user-space `CGEventTap` neither receives nor posts once the screen
is locked; the Windows service is out of scope besides (README D6). So
the condition is unconditionally true for a Mac receiver and the
always-eat-and-lock behaviour is the faithful port.

Recorded as docs/protocol.md 10.5 note 8 (appended, so the note numbers
existing citations use stay stable), as a feature README Assumptions
bullet, and as a comment at the site in `KeyState.processDown`. No
behaviour change.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
lucioandClaude Opus 5 committed 2026-09-16 03:06:27 -07:00
1 parent 3ea50a7ae3
commit 9a1ad519de
3 files changed
+46

No files matched your search

+18
View File
@@ -852,3 +852,21 @@ sees them. One subsection per lane, appended, never rewritten.
mouse's wheel is also a CP1 question; we post `.line` units with the sign the
capture side reads, so the two halves agree with each other whatever the
answer (see §10.4 note 10 for the still-unverified horizontal sign).
8. **The lock hotkey's desktop gate has no macOS equivalent, so the receiver
always eats it and always locks.** On Windows the `HotKeyLockMachine` match is
wrapped in `if (!Common.RunOnLogonDesktop && !Common.RunOnScrSaverDesktop)`
(`InputSimulation.cs:408-409`): on those two desktops `HotkeyMatched` can be
true while `eatKey` stays `false`, so the key is passed through and nothing
locks. Both flags are set only in `Program.Main` when the MWB **service**
launches a second copy of the process onto the `Winlogon` or `Screen-saver`
desktop (`Program.cs:150-167`, from `Common.RunOnScrSaverDesktop`/
`RunOnLogonDesktop`, `Common.cs:176-186`) — Win32 secure desktops, one process
instance per desktop, each with its own hook. macOS has no such split: there
is one process per login session, `loginwindow` and the screen saver are not
desktops that host a copy of us, and once the screen is actually locked the
system stops delivering to and posting from a user-space event tap anyway. The
condition is therefore unconditionally true for a Mac receiver, which is why
`KeyState.processDown` has no guard. The Windows service that creates those
desktops is out of scope in the first place (README D6). Note that the
hardcoded Win+L branch (`:450-460`) carries no such gate on Windows either, so
only the configurable hotkey was ever gated.