Skip to content

Keep Remote forwarding alive through unrelated keyboard removals - #1016

Merged
enaboapps merged 3 commits into
mainfrom
fix/remote-forwarding-device-removal-1015
Oct 11, 2026
Merged

enaboapps merged 3 commits into
mainfrom
fix/remote-forwarding-device-removal-1015

Conversation

@enaboapps

Copy link
Copy Markdown
Contributor

Closes #1015

Problem

Remote forwarding stopped unexpectedly on Windows. Diagnostic logging showed a paired Bluetooth LE HID device ("Grid Link") dropping and reconnecting every one to two seconds. Each drop sends WM_INPUT_DEVICE_CHANGE/GIDC_REMOVAL. Capture treated that as CaptureLost, and any local capture Stopped event called remote_scan::cancel, which ended the Remote session.

Changes

  • switch_input/windows_hook.rs: new State::device_removed interrupts capture only while a suppressed switch is held (Shared::has_owned), the only case where a removal can strand a key. Called from the Raw Input device-change handler in switch_input/windows.rs.
  • scanning_runtime.rs: while Remote scanning is active, a local capture failure (CaptureLost, HeartbeatTimeout, QueueOverflow) resets the scanner but keeps the Remote session, so the next tick restarts Remote scanning in place. This is the same pattern as the Remote emergency-hold reset. Escape, the local emergency hold and disabling still end the session.
  • Docs: docs/switches.md and docs/point-scan.md describe the new behaviour.

Validation

  • npm run prediction-model, npm run lint, npm test (293 + 12 passed), npm run build
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings
  • cargo test: 725 passed, including new tests device_removal_interrupts_only_while_a_switch_is_held and only_user_stops_end_remote_scanning
  • Diagnosis was done with temporary logging (not included) on the affected machine. The logs showed repeated GIDC_REMOVAL for HID#{00001812-…}_77efbdaf2334&Col02, each followed by a CaptureLost stop.

🤖 Generated with Claude Code

Windows capture treated every keyboard removal as lost capture, and any
local capture stop cancelled the Remote scanning session. A Bluetooth
keyboard that reconnects every second or two therefore ended forwarding.

Only interrupt capture on removal while a suppressed switch is held, and
let local capture failures restart Remote scanning in place instead of
ending the session. Escape and the local emergency hold still end it.

Closes #1015

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enaboapps enaboapps added this to the v1.0.0-rc.24 milestone Oct 11, 2026
OwenMcGirr and others added 2 commits October 11, 2026 15:33
Cover a device removal during recovery quarantine, pin the order in which
the Remote flag is read, and state that Remote ends when capture cannot
be re-armed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@enaboapps
enaboapps marked this pull request as ready for review October 11, 2026 14:36
@enaboapps
enaboapps merged commit d8286d2 into main Oct 11, 2026
6 checks passed
@enaboapps
enaboapps deleted the fix/remote-forwarding-device-removal-1015 branch October 11, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unrelated keyboard disconnects stop Remote forwarding

2 participants