Mirror number keys to both machines #8

Merged
erik merged 1 commit from feat/task-6f77414f-number-key-mirroring into main 2026-07-17 19:11:41 -05:00
Owner

Summary

Add opt-in mirroring for unmodified top-row number keys while Linux has control.

Task

task-6f77414f

Changes

  • Toggle number mirroring with Control + | while consuming the shortcut locally.
  • Forward mirrored number press, repeat, and release events to Linux without suppressing them on macOS.
  • Exclude modified numbers and numeric-keypad keys from mirroring.
  • Show the current mirroring state in the menu bar and reset it to off on app startup.
  • Keep releases balanced when mirroring is disabled while a number key is held.

Testing

  • Unit tests added/updated
  • Manual testing performed

Manual verification confirmed the menu state toggles with Control + | and resets to disabled after restarting the app.

Checklist

  • ./scripts/pre-pr.sh passes
  • Documentation updated (not needed)
  • No unrelated changes included
## Summary Add opt-in mirroring for unmodified top-row number keys while Linux has control. ## Task `task-6f77414f` ## Changes - Toggle number mirroring with `Control + |` while consuming the shortcut locally. - Forward mirrored number press, repeat, and release events to Linux without suppressing them on macOS. - Exclude modified numbers and numeric-keypad keys from mirroring. - Show the current mirroring state in the menu bar and reset it to off on app startup. - Keep releases balanced when mirroring is disabled while a number key is held. ## Testing - [x] Unit tests added/updated - [x] Manual testing performed Manual verification confirmed the menu state toggles with `Control + |` and resets to disabled after restarting the app. ## Checklist - [x] `./scripts/pre-pr.sh` passes - [x] Documentation updated (not needed) - [x] No unrelated changes included
feat: mirror number keys during Linux control
All checks were successful
CI / Rust build, lint, and test (pull_request) Successful in 12s
CI / Swift build, lint, and test (pull_request) Successful in 14s
27fed6cc41
Task: #task-6f77414f
Author
Owner

PR review

Summary

Approved. The change adds opt-in, in-memory mirroring for unmodified top-row number keys while Linux has control, consumes the local toggle shortcut, keeps mirrored releases balanced, exposes the state in the menu bar, and defaults the state to off at startup.

Acceptance criteria

  • MetControl + | toggles number mirroring without triggering an action on either machine. The shortcut path consumes key-down, repeats, and its matching key-up; manual testing verified the menu state toggles.
  • Met — With Linux control and mirroring enabled, unmodified top-row 1 through 0 are received by both machines. HID usages 0x001e...0x0027 are forwarded while local suppression is disabled.
  • Met — With mirroring disabled, number keys follow normal active-machine routing. The existing remote routing remains suppressing unless a mirrored press is tracked.
  • Met — Modified number keys and numeric-keypad keys are not mirrored. Modifier flags are checked, and mirroring is restricted to top-row HID usages; unit tests cover both exclusions.
  • Met — The menu-bar state accurately reflects whether number mirroring is enabled. The router callback updates AppState, which refreshes the menu item.
  • Met — Restarting the macOS app resets number mirroring to off. Both router and app state initialize in memory to false; manual restart testing verified this behavior.

Blocking issues

  • None.

Warnings

  • None.

Verification

  • Forgejo CI run #24: Rust and Swift jobs passed.
  • Local make check passed.
  • Local make pre-pr passed.
  • Manual testing verified Control + | toggles menu state and app restart resets it off.

Final verdict

Approved — all 6 acceptance criteria are met, with no blocking issues or warnings. Awaiting explicit human merge approval.

## PR review ### Summary Approved. The change adds opt-in, in-memory mirroring for unmodified top-row number keys while Linux has control, consumes the local toggle shortcut, keeps mirrored releases balanced, exposes the state in the menu bar, and defaults the state to off at startup. ### Acceptance criteria - **Met** — `Control + |` toggles number mirroring without triggering an action on either machine. The shortcut path consumes key-down, repeats, and its matching key-up; manual testing verified the menu state toggles. - **Met** — With Linux control and mirroring enabled, unmodified top-row `1` through `0` are received by both machines. HID usages `0x001e...0x0027` are forwarded while local suppression is disabled. - **Met** — With mirroring disabled, number keys follow normal active-machine routing. The existing remote routing remains suppressing unless a mirrored press is tracked. - **Met** — Modified number keys and numeric-keypad keys are not mirrored. Modifier flags are checked, and mirroring is restricted to top-row HID usages; unit tests cover both exclusions. - **Met** — The menu-bar state accurately reflects whether number mirroring is enabled. The router callback updates `AppState`, which refreshes the menu item. - **Met** — Restarting the macOS app resets number mirroring to off. Both router and app state initialize in memory to `false`; manual restart testing verified this behavior. ### Blocking issues - None. ### Warnings - None. ### Verification - Forgejo CI run #24: Rust and Swift jobs passed. - Local `make check` passed. - Local `make pre-pr` passed. - Manual testing verified `Control + |` toggles menu state and app restart resets it off. ### Final verdict **Approved** — all 6 acceptance criteria are met, with no blocking issues or warnings. Awaiting explicit human merge approval.
erik merged commit e717e8a2d7 into main 2026-07-17 19:11:41 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/kvshare!8
No description provided.