Skip to content

feat(buttons): add mouse gesture navigation - #1023

Open
tarnish233 wants to merge 2 commits into
Caldis:masterfrom
tarnish233:codex/mouse-gesture-navigation
Open

feat(buttons): add mouse gesture navigation#1023
tarnish233 wants to merge 2 commits into
Caldis:masterfrom
tarnish233:codex/mouse-gesture-navigation

Conversation

@tarnish233

@tarnish233 tarnish233 commented Aug 29, 2026

Copy link
Copy Markdown

Motivation

Mouse-button mappings cannot currently reproduce the gesture-button workflow provided by Logi Options+: click the assigned button for Mission Control, or hold it and move the mouse for directional navigation.

Closes #949
Related to #917

What changed

  • Add a localized Gesture Navigation preset under Function Keys rather than the synthetic mouse-button actions.
  • Support both native CGEvent mouse buttons and Logi HID++ buttons through the existing unified InputProcessor path.
  • Activate mouse-motion interception only while a gesture button is held, without freezing or rewriting pointer movement.
  • Map the preset to:
    • click → Mission Control
    • move up → Mission Control
    • move down → App Exposé
    • move left → switch one Space to the right
    • move right → switch one Space to the left
  • Defer synthetic shortcut posting until after the event-tap callback returns, avoiding callback re-entry and tap timeouts.
  • Make gesture navigation deliberate and one-shot:
    • each button hold can commit at most one directional action;
    • continued movement, pauses, and reversals are ignored after the first direction commits;
    • releasing and pressing the gesture button starts a fresh gesture session;
    • this prevents one physical swipe from accidentally moving across multiple Spaces.
  • Keep existing ButtonBinding identifiers and persistence format unchanged.

Validation

  • Full Debug test suite on the current PR head:
    • 566 tests executed
    • 3 environment-gated tests skipped
    • 0 failures
  • git diff --check
  • Manual validation by the issue author with the Debug build:
    • binding and menu placement;
    • click action;
    • all four directions;
    • corrected left/right mapping;
    • one action per button hold;
    • confirmed improved feel without accidental repeated Space movement.

Compatibility / risk notes

  • Uses public CGEvent and existing system-shortcut execution paths only; no private multitouch APIs.
  • Uses APIs available within Mos's macOS 10.13 deployment target.
  • Does not change Accessibility prompts, defaults keys, or persisted binding schemas.

Add a Logi Options+-style gesture preset for button mappings. A click opens Mission Control, directional movement dispatches window-navigation shortcuts, and horizontal gestures support deliberate repeat and reversal without changing persisted bindings.
@tarnish233

Copy link
Copy Markdown
Author

我这边目前测试了 logi m750 和 迈从 A5 鼠标都是正常的,代码是 codex 写的

Ignore continued, paused, or reversed pointer movement after a gesture direction commits. A new action is available only after releasing and pressing the gesture button again.
@tarnish233

Copy link
Copy Markdown
Author

改成一次按住最多触发一次了,之前偶尔会误触发,求合并

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.

Logi 鼠标请求新增手势操作功能

1 participant