Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Sig_Dude

macrumors newbie
Original poster
Jan 9, 2022
28
12
If I turn off "natural scrolling" for my Bluetooth mouse, natural scrolling is then automatically turned off for the trackpad as well.

How do I set the mouse and trackpad natural scrolling settings independently?

I prefer to have NS turned on for the trackpad and turned off for the mouse.

Thanks for any replies.
 
  • Like
Reactions: Basic75
I tried several 3rd party solutions which allow to set the scroll direction independently (like Scroll Reverser).
But all of them break swipe gestures to some extend (like two-finger-swipe in Safari to get to the previous page).
I finally wrote an Apple Script that checks if my Bluetooth mouse is connected or not and ticks 'Natural Scrolling' accordingly.
In my case I have it as login item but there are numerous ways to trigger it.
- You have to specify the name of your mouse in the first line.
- As I still use macOS Big Sur, that's what I wrote it for but it should be a good starting point (in case this is a viable workaround for you).
AppleScript:
set the_mouse_name to "Magic-Mouse-2"
-- check if bluetooth mouse is currently connected
set mouse_connected to (do shell script "system_profiler SPBluetoothDataType | sed '1,/" & the_mouse_name & "/d' | grep \"Connected: \" | head -1") as string
if mouse_connected contains "Connected: Yes" then
    set scroll_direction_natural to 0
else
    set scroll_direction_natural to 1
end if
-- check if natural scrolling is currently active
set swipescrolldirection to (do shell script "defaults read -g com.apple.swipescrolldirection")
-- adjust natural scrolling (if necessary) by opening system preferences
if swipescrolldirection as number is not scroll_direction_natural as number then
    tell application "System Preferences"
        reveal pane "Trackpad"
        activate
    end tell
    delay 0.5
    tell application "System Events" to tell process "System Preferences"
        click radio button 2 of tab group 1 of window "Trackpad"
        click checkbox 1 of tab group 1 of window "Trackpad"
    end tell
    delay 0.5
    tell application "System Preferences" to quit
end if

To get the correct button/checkbox identifiers for Ventura, you can record your clicks with Automator and inspect your actions as Apple Script.
 
Last edited:
  • Like
Reactions: Sig_Dude
I tried several 3rd party solutions which allow to set the scroll direction independently (like Scroll Reverser).
But all of them break swipe gestures to some extend (like two-finger-swipe in Safari to get to the previous page).
I finally wrote an Apple Script that checks if my Bluetooth mouse is connected or not and ticks 'Natural Scrolling' accordingly.
In my case I have it as login item but there are numerous ways to trigger it.
- You have to specify the name of your mouse in the first line.
- As I still use macOS Big Sur, that's what I wrote it for but it should be a good starting point (in case this is a viable workaround for you).
AppleScript:
set the_mouse_name to "Magic-Mouse-2"
-- check if bluetooth mouse is currently connected
set mouse_connected to (do shell script "system_profiler SPBluetoothDataType | sed '1,/" & the_mouse_name & "/d' | grep \"Connected: \" | head -1") as string
if mouse_connected contains "Connected: Yes" then
    set scroll_direction_natural to 0
else
    set scroll_direction_natural to 1
end if
-- check if natural scrolling is currently active
set swipescrolldirection to (do shell script "defaults read -g com.apple.swipescrolldirection")
-- adjust natural scrolling (if necessary) by opening system preferences
if swipescrolldirection as number is not scroll_direction_natural as number then
    tell application "System Preferences"
        reveal pane "Trackpad"
        activate
    end tell
    delay 0.5
    tell application "System Events" to tell process "System Preferences"
        click radio button 2 of tab group 1 of window "Trackpad"
        click checkbox 1 of tab group 1 of window "Trackpad"
    end tell
    delay 0.5
    tell application "System Preferences" to quit
end if

To get the correct button/checkbox identifiers for Ventura, you can record your clicks with Automator and inspect your actions as Apple Script.
Thank you for the reply, and for sharing the script.

It sounds like this functionality is not native, which is a bit mind-blowing, to be honest.

Hopefully, this will be addressed in a future build.

For the time being, I'll manually switch natural scrolling on and off.
 
I want this functionality as well. It's a a really obvious function which should have been there since the Day 1, yet here we are, countless years later, with still no official way of unbreaking the tie between the scrolling-behaviour of a trackpad vs mouse-wheel.
 
If you are using a Logitech mouse, then the Logi Options software will allow you to set the mouse however you want. You leave MacOS as "natural" then set the Logi software for the mouse to the appropriate setting.
 
In case someone is actually using an AppleScript, thanks to a link provided by @theorist9, the following script now works completely invisible without the need of opening system preferences by using Python's framework functions.
AppleScript:
set theMouseName to "Magic-Mouse-2"
-- check if said bluetooth mouse is currently connected
set theMouseConnected to (do shell script "system_profiler SPBluetoothDataType | sed '1,/" & theMouseName & "/d' | grep \"Connected: \" | head -1") as string
set theScrollDirectionNatural to 1
if theMouseConnected contains "Connected: Yes" then set theScrollDirectionNatural to 0
-- check if natural scrolling is currently active
set theSwipeScrollDirection to (do shell script "defaults read -g com.apple.swipescrolldirection")
-- script to toggle "Natural Scrolling"
set toggleNaturalScrolling to "python -c 'from ctypes import cdll
lib = cdll.LoadLibrary(\"/System/Library/PrivateFrameworks/PreferencePanesSupport.framework/Versions/A/PreferencePanesSupport\")
lib.setSwipeScrollDirection(lib.swipeScrollDirection() == 0)
'"
if theSwipeScrollDirection as number is not theScrollDirectionNatural as number then
    do shell script toggleNaturalScrolling
end if

EDIT: Will add a Python version check as newer systems (macOS 12.4+) come with Python 3 instead of 2 and therefore have to execute python3 -c
 
Last edited:
  • Love
Reactions: theorist9
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.