Skip to content

Persist mouse-gesture binding selection, add numeric chooser and wheel-gate#773

Merged
multiplex55 merged 2 commits intomasterfrom
codex/implement-mouse-gestures-enhancements
Jan 31, 2026
Merged

Persist mouse-gesture binding selection, add numeric chooser and wheel-gate#773
multiplex55 merged 2 commits intomasterfrom
codex/implement-mouse-gestures-enhancements

Conversation

@multiplex55
Copy link
Copy Markdown
Owner

Motivation

  • Remember and restore the last-selected binding for a gesture (label+tokens) so repeated gestures default to the user’s last choice.
  • Improve multi-binding UX by showing a numbered chooser in the hint overlay and allowing numeric keyboard selection as well as gated wheel cycling.

Description

  • Added a lightweight JSON state store (mouse_gestures_state.json) and helper functions load_selection_state / save_selection_state to persist last-selected binding index per gesture (keyed by label::tokens).
  • Extended MouseGestureConfig with wheel_cycle_gate and new WheelCycleGate enum, wired through plugin settings (MouseGestureSettings) and the GUI settings dialog (mouse_gesture_settings_dialog.rs).
  • Updated service.rs to initialize selected_binding_idx from stored state when an exact candidate appears, and to save selection on SelectBinding / wheel-cycling changes.
  • Reworked hint rendering in format_hint_text to output a numbered binding chooser (e.g. 1) Action A, 2) Action B) and to include updated hint text describing the wheel gate and numeric selection.
  • Extended HookEvent to include CycleNext, CyclePrev, and SelectBinding(usize) and updated hook logic to map mouse wheel to cycle events and 1-9 key presses to SelectBinding when a gesture is active; added platform gate logic so wheel cycling can be gated behind deadzone or Shift+Wheel on Windows.
  • Added wheel_gate state to the Windows HookDispatch and appropriate logic in mouse_hook_proc / keyboard_hook_proc to enforce the gate and forward cycle/select events.
  • Added unit tests in tests/mouse_gestures_service.rs covering selection persistence across gesture sessions and numeric selection updating the hint overlay, and adjusted an existing hint text assertion to the new format.

Testing

  • Ran cargo fmt successfully to format changes.
  • Attempted cargo test mouse_gestures_service, but the test run failed during build due to an external system dependency (missing system alsa / alsa.pc) required by alsa-sys; the added tests are present but could not be executed in this environment because of that missing native dependency.

Codex Task

@multiplex55 multiplex55 merged commit 80eafab into master Jan 31, 2026
1 check failed
@multiplex55 multiplex55 deleted the codex/implement-mouse-gestures-enhancements branch February 1, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant