Skip to content

fix: prevent unintended thumbwheel tap actions - #464

Open
mvanhorn wants to merge 1 commit into
AprilNEA:masterfrom
mvanhorn:fix/435-prevent-unintended-thumbwheel-tap
Open

fix: prevent unintended thumbwheel tap actions#464
mvanhorn wants to merge 1 commit into
AprilNEA:masterfrom
mvanhorn:fix/435-prevent-unintended-thumbwheel-tap

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

Replace the watcher's single thumb-wheel armed flag with a typed capture mode that distinguishes native reporting, diverted rotation only, and diverted rotation with tap delivery; derive it from sensitivity plus the effective click and rotation bindings. Thread that mode through run_capture_session, export it from openlogi-hid, and include it in the manager's desired/current session state so changing the thumb-wheel click binding restarts capture with the correct behavior. Keep rotation decoding and re-synthesis unchanged, but have the HID listener emit ButtonPressed(Thumbwheel) only when the mode explicitly includes taps, preventing rotation inversion from activating the seeded App Exposé default.

Why

On an MX Master 3S, swapping the horizontal thumb-wheel directions causes touching the wheel to launch App Exposé even though only rotation was edited. The current watcher diverts HID++ Thumbwheel feature 0x2150 whenever either rotation binding differs from its default, and the diverted listener then forwards every reported single tap as ButtonId::Thumbwheel. The effective binding map always seeds that button with App Exposé, so rotation-only customization unintentionally activates a dormant default tap action. This path remains present on current master, and there are no open or previously closed cross-referenced PRs for the issue.

Testing

  • Happy path: swap ThumbwheelScrollUp and ThumbwheelScrollDown while the thumb-wheel click remains at its seeded default; the watcher selects rotation-only capture, wheel rotation scrolls in the inverted direction, and a tap/touch report emits no App Exposé action.
  • Edge cases: a non-default thumb-wheel sensitivity still selects rotation-only capture, while explicitly rebinding Thumbwheel selects rotation-plus-tap and continues to deliver exactly one button event alongside any nonzero rotation in the same HID++ report.
  • Error paths: at default sensitivity, an unavailable or poisoned effective binding map falls back to no diversion instead of enabling tap capture, and unrelated, response, or zero-motion HID++ messages without a tap continue to produce no captured input.

Fixes #435

AI was used for assistance.

@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown

Greptile Summary

The PR separates thumbwheel rotation capture from tap delivery.

  • Adds native, diverted-rotation, and diverted-rotation-plus-tap capture modes.
  • Restarts capture when the effective thumbwheel mode changes.
  • Suppresses tap events for rotation-only customization while preserving diverted rotation.
  • Adds unit coverage for capture-mode selection and event forwarding.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/openlogi-agent-core/src/watchers/gesture.rs Derives and tracks the typed thumbwheel capture mode from sensitivity and effective bindings.
crates/openlogi-hid/src/gesture.rs Applies the typed mode during diversion and independently gates rotation and tap forwarding.
crates/openlogi-hid/src/gesture/tests.rs Covers rotation-only, rotation-plus-tap, zero-motion, and native forwarding behavior.
crates/openlogi-hid/src/lib.rs Re-exports the new thumbwheel capture-mode type.

Sequence Diagram

sequenceDiagram
  participant Config as Effective bindings
  participant Watcher as Gesture watcher
  participant HID as HID capture session
  participant Device as Thumbwheel
  participant Dispatch as Action dispatcher
  Config->>Watcher: Sensitivity and click/rotation bindings
  Watcher->>Watcher: Derive capture mode
  Watcher->>HID: Start or restart session with mode
  HID->>Device: Keep native or enable diverted reporting
  Device-->>HID: Rotation and optional tap report
  alt Diverted rotation only
    HID->>Dispatch: Forward rotation
  else Diverted rotation and tap
    HID->>Dispatch: Forward tap and rotation
  else Native
    Device-->>Config: OS handles native reporting
  end
Loading

Reviews (2): Last reviewed commit: "fix: prevent unintended thumbwheel tap a..." | Re-trigger Greptile

@mvanhorn
mvanhorn force-pushed the fix/435-prevent-unintended-thumbwheel-tap branch from 06235ec to 0d4b9af Compare July 26, 2026 20:58
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.

[Bug]: Capacitive touch on the horizontal scroll whell

1 participant