Jump to content

How to make a shortcut for another key (Mac)

My friend recently spilled his drink on his mac and his enter and backspace keys aren't working, i was wondering if there was a way to make a shortcut to fill in those keys

Link to comment
Share on other sites

Link to post
Share on other sites

Don't put your friends macbook in the dishwasher. Use this command:

hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":[KEY A],"HIDKeyboardModifierMappingDst":[KEY B]},{"HIDKeyboardModifierMappingSrc":[KEY B],"HIDKeyboardModifierMappingDst":[KEY A]}]}'

Substitute [KEY A] and [KEY B] with the keys you want to swap. The keys are entered as a hex value, see this link:

https://developer.apple.com/library/archive/technotes/tn2450/_index.html

 

So if you want to swap the Enter-key with, lets say, Right-Shift-key, you run:

hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000028,"HIDKeyboardModifierMappingDst":0x7000000E5},{"HIDKeyboardModifierMappingSrc":0x7000000E5,"HIDKeyboardModifierMappingDst":0x700000028}]}'

To reset you just run the command again with the same key as src and dst. 

 

Do people use MacUpdate in 2018? ?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×