Skip to content

fix: preserve modifier releases from Windows to macOS - #523

Open
Jayocean2000 wants to merge 4 commits into
feschber:mainfrom
Jayocean2000:codex/fix-stuck-modifiers
Open

Jayocean2000 wants to merge 4 commits into
feschber:mainfrom
Jayocean2000:codex/fix-stuck-modifiers

Conversation

@Jayocean2000

Copy link
Copy Markdown

When a Windows host shares input with macOS, ordinary clicks can intermittently behave as Ctrl-clicks after the physical modifier has been released. This change addresses two paths that can leave the remote key state inconsistent.

  • Windows capture uses a non-blocking unbounded channel instead of a capacity-10 channel whose try_send can discard key/button releases behind mouse motion. Hook callbacks also pass negative hook codes to the next hook before reading event data.
  • macOS posts each received key press/release independently of the repeat task. Only non-modifier keys repeat, cancelling repeat no longer synthesizes a key release, and releasing another key does not cancel the currently repeating key. Destroy/terminate stop the repeat task. Pointer events explicitly use the received modifier state.

Validation:

  • cargo fmt --all --check and git diff --check passed.
  • cargo test --workspace passed on macOS, including three modifier/repeat regression tests.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings passed on macOS.
  • The unchanged Windows capture changes were built and tested natively on Windows with cargo test -p input-capture -p input-emulation --no-default-features; the motion-burst/release regression passed. A Windows GTK release build was deployed for initial Windows-to-macOS use.
  • Initial manual use reports that the intermittent Ctrl-click symptom appears resolved; prolonged stress testing is still needed. The published macOS source preserves the latest upstream key mapping; the deployed test build additionally contains local click-focus changes that are excluded from this PR.

Known limitations:

  • Win+G still opens Xbox Game Bar on the Windows host while input is captured for macOS. This PR does not fix that shortcut behavior. The README records this observed limitation.
  • An unbounded Windows queue can grow if the consumer stalls. This avoids losing release events or blocking a low-level hook; motion coalescing may be needed if sustained backlog is observed.

No protocol or configuration changes.

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.

1 participant