Skip to content

Add wheel scroll settings#94

Open
klovinad wants to merge 2 commits into
AprilNEA:masterfrom
klovinad:proposal/wheel-scroll-settings
Open

Add wheel scroll settings#94
klovinad wants to merge 2 commits into
AprilNEA:masterfrom
klovinad:proposal/wheel-scroll-settings

Conversation

@klovinad
Copy link
Copy Markdown

@klovinad klovinad commented Jun 2, 2026

Summary

This proposes two related mouse-control improvements:

  • Change the default horizontal gesture-button swipes to switch macOS desktops/spaces:
    • Left → Previous Desktop
    • Right → Next Desktop
  • Add app-wide scroll wheel preferences:
    • invert wheel direction
    • scroll strength multiplier
    • tactility/chunking

Implementation notes

  • Scroll preferences are persisted in AppSettings and mirrored into the hook runtime through a shared ScrollSettings value.
  • The hook transforms captured scroll events only when non-default scroll settings are active; default settings pass through natively.
  • Synthetic transformed scroll events are posted at the session tap to avoid being re-captured by OpenLogi's own HID event tap.
  • Added unit coverage for scroll axis ordering, inversion, and chunking.

Verification

Ran locally on macOS:

cargo fmt --all
cargo check -p openlogi-gui
cargo test -p openlogi-gui -p openlogi-core

Results:

  • openlogi-core: 34 passed
  • openlogi-gui: 14 passed

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Minor suggestions inline — one observation about the scroll-settings default check.

Reviewed changes — Adds three scroll-preference controls (invert, strength, tactility) to the Settings window and changes default horizontal gesture swipes to desktop/Space switching.

  • Default gesture direction updatePrevTab/NextTab replaced with PreviousDesktop/NextDesktop.
  • ScrollSettings shared stateArc<RwLock<ScrollSettings>> mirrors the persisted config to the hook runtime.
  • Scroll event transformationtransform_scroll/quantize_scroll apply inversion, strength, and chunking to captured wheel events.
  • Session-tap re-injection — Transformed scroll events are posted at CGEventTapLocation::Session to avoid re-capture by OpenLogi's HID tap.
  • Settings UI — Invert switch, strength slider (1–10), and tactility slider (0–10) in a new "Scroll" group box.
  • Generalized setting_row — Signature changed from control: Switch to control: impl IntoElement to accept sliders alongside switches.
  • Expanded native-click passthroughBackBrowserBack and ForwardBrowserForward added.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Big Pickle (free) (credentials for Anthropic not configured) | 𝕏

Comment thread crates/openlogi-gui/src/hook_runtime.rs
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Prior feedback addressed — no new issues found.

Reviewed changes — Fixed the ScrollSettings::default() mismatch with AppSettings defaults by replacing the derived Default with a manual impl whose strength: 1 matches the app config.

  • Manual Default impl for ScrollSettings — Replaced #[derive(Default)] with a manual impl Default where strength: 1 aligns with AppSettings::wheel_strength. This restores the identity fast-path in hook_runtime.rs.

Pullfrog  | View workflow run | Using Big Pickle (free) (credentials for Anthropic not configured) | 𝕏

@averypelle
Copy link
Copy Markdown

This should close #126

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.

2 participants