enable right click for users

stephaniemm77
Contributor

Has anyone been able to get mice to have right-click enabled by default? We are running lab machines with new users logging in all the time and would prefer they not have to enable that for themselves each time. I have seen (and tried) various solutions here on Jamf (scripts run in a policy) but have not been able to get it to work. I am interested if anyone has had any success?

We use Logitech Mice in most of our classrooms, since the apple studio doesn't come with mice/keyboards and most of our users prefer them over the apple mouse anyway.

4 REPLIES 4

spesh
New Contributor III

Are the Logitech mice you are using connecting via Bluetooth? Or are you using a Logitech driver/preference pane to configure them? 

I have done this in the past with Apple magic mice (I know, not the most helpful for your situation). Only caveat was users would have to log out and log back in for it to take effect, but this was the command I was deploying to enable this: 

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

PaulHazelden
Valued Contributor

I use a script It is run in a loop and adds the setting to the Templates, but you can change that and make it run on existing accounts. ${USER_TEMPLATE} is the variable from the loop.

# Mouse secondary button

/usr/bin/defaults write /Library/User\ Template/${USER_TEMPLATE}/Library/Preferences/com.apple.driver.AppleHIDMouse.plist Button2 -int 2

I have no problem with this running on Ventura, we use Cherry wired Mouses.

/usr/bin/defaults write /Users/<USER HOME>/Library/Preferences/com.apple.driver.AppleHIDMouse.plist Button2 -int 2

Should, if you replace <USER HOME> with a valid account, work just fine.

I run this as I set up the Macs, I could set it to run at login, but I don't because once i have set it and they have logged in it is up to them to maintain their own set up.

Fwatson
New Contributor II

If it helps I've also been struggling for ages with how to make this work. I know PaulHazelden's solution is the one that's linked in all threads I've found discussing this, but as you said you've tried policy scripts you've seen on here I'm assuming you're in the same boat as me and just can't figure out how to get that solution to work for you.

PaulHazelden
Valued Contributor

My script runs as the Mac is being first set up, straight after enrollment. For me at this point there is only my admin account set up. So I only really need to run the change on the User Templates. But I do run it on my admin account as well.
1. I would check to see if the paths exist in the templates. I have seen in the past the Preferences folder missing from some of the templates, and the Plist has nowhere to save into. If it is missing then create the folders you need as a part of the loop through the templates. Check the same in your user account folders, make sure everything is there.
2. Check ownership and permissions on the plist you create. My script is being run as root, it is the Jamf server running it. So it creates the permissions as root, and it is owned by root. In the templates folder this is not a problem, the contents of the templates are owned by root:wheel. But in the Users home folders this will be a problem, you will need to change the owner:group to be correct for each user.