Is it possible to enable mouse right click via Terminal?

Is it possible to enable mouse right click via Terminal?


Try defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode TwoButton

To undo: defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode OneButton


Depends on mouse you are using too I believe, why not something like this if its the regular Apple mouse?

defaults write /Library/Preferences/com.apple.driver.AppleHIDMouse.plist Button2 -int 2

Or

defaults write /Users/username/Library/Preferences/com.apple.driver.AppleHIDMouse.plist Button2 -int 2

If others search for how to perform a right click from a shell script, you can use MouseTools:

MouseTools -x 1000 -y 500;MouseTools -rightClick

This worked for me Restart required

defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode TwoButton
defaults write com.apple.AppleMultitouchMouse.plist MouseButtonMode TwoButton

to revert change TwoButton to OneButton