Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change scroll direction on mac programatically, assign to key combination command

I am wondering if there is a way to switch the scroll direction on a mac/osx (yosemite) programatically. If so, I want to assign some sort of script or command to a key combination to switch it quickly. I work on a mac but consistently log into windows computers and my brain wants to scroll the wrong way all the time. I haven't programmed anything on mac, still very new to it, but have done plenty in linux and assume its somewhat similar to bash scripting.

the ultimate end goal would be to have this react to a mouse being plugged in also to change both at the same time if needed, i just think it feels more natural to scroll like a windows pc on a mouse and more natural in the osx way on a trackpad. this is really just for fun and ease of use.

like image 540
wondergoat77 Avatar asked Jun 10 '15 21:06

wondergoat77


1 Answers

I found an answer here using the defaults command:

Write with: defaults write -g com.apple.swipescrolldirection -bool FALSE (or TRUE)

Read the current value with: defaults read -g com.apple.swipescrolldirection.

like image 58
AndrewO Avatar answered Oct 20 '22 01:10

AndrewO