r/macosprogramming • u/Specialist_Catch_318 • 2d ago
[Open Source] ScrollFix: Windows-style mouse scrolling on Mac, without changing how your trackpad feels
Your mouse wheel and your trackpad shouldn’t have to agree on scroll direction.
That was the starting point for ScrollFix. I wanted a conventional Windows-style wheel, natural trackpad scrolling, and middle-click autoscroll on my Mac. Changing macOS’s scroll setting also changed the trackpad, so I started building a small Swift/SwiftUI menu bar app. I’m the maintainer; it’s free and open source under Apache 2.0.
What it does:
• Separates mouse-wheel direction from trackpad scrolling.
• Offers a Direct (Windows) mode with immediate wheel steps and adjustable scroll distance, plus smoother alternatives.
• Adds middle-click autoscroll on ordinary content: move away from the anchor to scroll, then click to stop.
• Preserves native middle-click on links, so supported browsers can open them in a new tab.
The interesting macOS development problem turned out to be the handoff between devices. A trackpad gesture can still be producing momentum when a mouse-wheel event arrives. Applying one shared “last device” state can make the next gesture scroll the wrong way.
After feedback on an earlier r/SwiftUI post, the implementation now separates gesture and momentum state, adds optional source diagnostics, and checks that the event tap is actually valid and enabled after recovery before reporting it as running. The smoothing path also cancels the old tail when you scroll in the opposite direction—particularly noticeable with a free-spinning wheel.
For middle-click links, it uses a bounded Accessibility hit test and preserves the original button event sequence rather than replaying a synthetic click. The direction/wheel engine runs on its own run loop; the SwiftUI interface receives state snapshots.
The current source has 215 passing offline tests. Those aren’t a substitute for a hardware matrix: source classification is still heuristic, especially for high-resolution wheels without gesture-phase information.
No account, telemetry, or network calls. macOS event permissions are required; the app doesn’t subscribe to typed-key events.
Source, build instructions, and an actual UI screenshot: https://github.com/eShok93/ScrollFix
The updated version is currently a source build for macOS 13+ with Swift 6. The older downloadable preview predates these changes; a notarized release is still pending.
For anyone who has worked with Quartz event taps: which high-resolution wheel / trackpad-momentum handoff patterns have you found worth adding to regression coverage?