This has worked on all OS X versions so far however not currently working on 10.10.4.
Its an interesting error as the Sys Prefs GUI displays that button 2 is set for Secondary Click but it is not working. If you go into Sys Prefs and manually change the option then put it back to Secondary Click, all is well however this is not an option when managing many hundreds of Mac's.
I would be very interested to hear if anyone else has discovered this and of course if someone has a fix?
Best answer by jjones11
Hmmm running it manually with this command below seems it works, but upon logging out/in, it does not set the right click. Seems Apple threw another change in the backgrounds possibly? (note to change this plist as yours is a desktop plist, mine is a laptop plist)
Another way you may be able to do this is by enabling it in the default template, this would stop the need of having it run at each login unless you are wanting persistance.
Hmmm running it manually with this command below seems it works, but upon logging out/in, it does not set the right click. Seems Apple threw another change in the backgrounds possibly? (note to change this plist as yours is a desktop plist, mine is a laptop plist)
Another way you may be able to do this is by enabling it in the default template, this would stop the need of having it run at each login unless you are wanting persistance.
I tried killing it, and the defaults did not take place, before 10.10.4 i recall not having to kill this, looks like Apple may have changed something in the background.
Its all actually a bit of hit and miss, which does make me think its a caching issue. If I manually run the defaults command Sys Prefs change but right click is not working. If I then log out and log back in it "sometimes" works?
An interesting scenario appeared in testing as well where I ran the defaults command logged out n back in and left click was set to secondary as well but reading as primary in Sys Prefs as well as in the plist file itself. After running killall cfprefsd all was well again!
There is obviously something strange going on here but I don't think its worth loosing sleep over LOL.
I think the fix is going to make the setting in the user templates and be done with it as that does seem to work every time...... so far!