Macos – Remap caps lock to escape in OS X

capslockkeyboardkeyboard-layoutkeymapmacos

I've always remapped my caps lock key to escape in windows/linux, but having just recently moved to OS X I can't seem to find a way to actually do this. Any idea as to how to set this up? Xmodmap seems to only be respected by x11 applications, and I'd highly prefer this to be system wide.

Best Answer

There's a Preference Pane called PCKeyboardHack that lets you remap keys based on a keycode. Remap Caps Lock to keycode 53 (the escape key).

Given that PCKeyboardHack works at the driver level, it works system-wide. I installed it and tried it myself, and it did what I think you want (when I press the key labelled 'Caps Lock', the action that would normally be triggered by pressing the Escape key is performed).

Related Question