A lightweight macOS CLI tool that reverses mouse scroll wheel direction without affecting the trackpad or Magic Mouse.
Runs as a background service, survives sleep/wake cycles, and persists across reboots.
brew tap CyrusZhang23/reversemousescroll
brew install reversemousescrollThen run the setup:
ReverseMouseScroll --installWhen you run --install, it will:
- Copy the binary to
~/Library/Application Support/ReverseMouseScroll/ - Register a launchd service (auto-start on login)
- Open Finder highlighting the installed binary
- Open System Settings → Privacy & Security → Accessibility
Drag the highlighted file into the Accessibility list and enable it, then press Enter to finish.
Note: If an old entry already exists in Accessibility, remove it first (click
−), then re-add.
| Command | Description |
|---|---|
--install |
Install and start the background service |
--uninstall |
Stop the service and remove all files |
--status |
Show whether the service is running |
--show |
Show current scroll direction config |
--setreverse |
Change scroll direction (see below) |
--run |
Run in foreground for debugging (Ctrl+C to stop) |
Set X and Y axes independently. Both can be changed in one command.
# Reverse vertical scroll (most common — matches Windows-style)
ReverseMouseScroll --setreverse y reverse
# Restore vertical to normal
ReverseMouseScroll --setreverse y normal
# Reverse horizontal scroll
ReverseMouseScroll --setreverse x reverse
# Set both at once
ReverseMouseScroll --setreverse y reverse x normalValid values: normal | reverse
Changes take effect immediately — no need to restart the service.
X-Axis: Normal ➡️
Y-Axis: Reverse 🔄
Status: Running
Status: Installed (Stopped)
Status: Not Installed
| Axis | Default |
|---|---|
| Y (vertical) | reverse |
| X (horizontal) | normal |
- Uses
CGEventTapto intercept scroll wheel events at the session level - Detects event source:
isContinuous == 0means physical mouse wheel → applies reversal; trackpad and Magic Mouse use continuous events → passed through unchanged - Config is stored in
UserDefaultsand read on every event, so--setreverseupdates take effect instantly without restarting - The launchd service uses
KeepAlive: trueto auto-restart on crash - On sleep/wake, the event tap is automatically rebuilt
ReverseMouseScroll --uninstallThis stops the service, removes the launchd plist, and deletes the binary from Application Support. After uninstalling via Homebrew:
brew uninstall reversemousescroll
brew untap CyrusZhang23/reversemousescrollThen manually remove the entry from System Settings → Privacy & Security → Accessibility.
Requires Xcode 14+ and macOS 12+.
git clone https://github.com/CyrusZhang23/ReverseMouseScroll.git
cd ReverseMouseScroll
swift build -c release
.build/release/ReverseMouseScroll --installMIT