Running OSX 10.7.4
I wrote a script to swap Apple Magic Mouse secondary click.
The following simple bash script do modify the system preferences (can be seen in System Preferences GUI), but the mouse secondary click is not really swapped.
#!/bin/bash
mmode=$(defaults read com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode)
echo --- $mmode ---
if [ $mmode = 'TwoButton' ]; then
defaults write com.apple.driver.AppleBluetoothMultitouch.mouse "save.MouseButtonMode.v1" -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string "TwoButtonSwapped"
echo LEFT HAND MODE
else
defaults write com.apple.driver.AppleBluetoothMultitouch.mouse "save.MouseButtonMode.v1" -int 1
defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string "TwoButton"
echo RIGHT HAND MODE
fi
It seems the OS needs some reload/refresh command for the change to take effect. Can anyone figure out what I'm missing?