Remap Caps Lock to Escape or Control

lawrencecchen

Lawrence Chen

Posted on June 11, 2021

Remap Caps Lock to Escape or Control

Emacs

Caps Lock to Control

hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x7000000E0}]}'
Enter fullscreen mode Exit fullscreen mode

Vim

Caps Lock to Escape

hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}'
Enter fullscreen mode Exit fullscreen mode

This seems to not affect external keyboards in my setup. If you know a fix, please drop a comment!

Reset

Caps Lock to Caps Lock

hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000039}]}'
Enter fullscreen mode Exit fullscreen mode

Learn More (Remap Other Keys)

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

Credits: https://superuser.com/a/1405422

💖 💪 🙅 🚩
lawrencecchen
Lawrence Chen

Posted on June 11, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related