DEV Community

Lawrence Chen
Lawrence Chen

Posted on • Edited on

1 1

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

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up