Replace right option with right alt on mac osx

By default when you want to use some national polish chars on macosx keyboard you need to use right alt. More convenient and natural however is to use right command key which is closer to your right tumb. You could replace the keys with Karabiner (https://pqrs.org/osx/karabiner/) but if its only thing you need Karabiner for then its better to do it without installing third party software.

Here is the deal how to do it.

The command to replace the keys is:

hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x7000000e7, "HIDKeyboardModifierMappingDst":0x7000000e6},{"HIDKeyboardModifierMappingSrc":0x7000000e6, "HIDKeyboardModifierMappingDst":0x7000000e7}]}' &> /dev/null

However after restarting computer the keys are reverted again to original. One of the way to make it permanent is to put this in ~/.profile or in ~/.bashrc.

Mind ‘&> /dev/null’ at the end. It will hide the output of hidutil command.

hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x7000000e7, "HIDKeyboardModifierMappingDst":0x7000000e6},{"HIDKeyboardModifierMappingSrc":0x7000000e6, "HIDKeyboardModifierMappingDst":0x7000000e7}]}' &> /dev/null

 

 

Leave a Comment.