Uncapping caps lock

Written January 2, 2024

I remapped the caps lock key on my macbook pro to fn and bound several useful shortcuts to it.

layout

made with keyboard-layout-editor.com

The number row turns into the original mac function keys (no siri or spotlight), namely screen brightness, mission control, launchpad, keyboard brightness, playback controls, and volume. These are especially useful for macs afflicted with touchbars.

Along the homerow, I placed keys which are mapped to a shortcut, to a sequence of keys to achieve a more complex operation

How I did it

I used Karabiner-Elements, a keyboard customization program for macOS. Bindings are configured tediously with a json file. For example, here's the config for select/extend word:

{
    "description": "a = select word",
    "type": "basic",
    "from": {"key_code": "a", "modifiers": {"mandatory": ["fn"]}},
    "to": [
        {"key_code": "right_arrow"},
        {"key_code": "left_arrow", "modifiers": ["option"]},
        {"key_code": "right_arrow", "modifiers": ["shift", "option"]},
        {"set_variable": {"name": "word_pressed", "value": 1}}
    ],
    "conditions": [
        {"type": "variable_if", "name": "word_pressed", "value": 0}
    ]
},
{
    "description": "multi-tap a = extend word selection",
    "type": "basic",
    "from": {"key_code": "a", "modifiers": {"mandatory": ["fn"]}},
    "to": [
        {"key_code": "right_arrow", "modifiers": ["shift", "option"]}
    ],
    "conditions": [
        {"type": "variable_if", "name": "word_pressed", "value": 1}
    ]
},

Installation instructions

  1. Install karabiner-elements (brew install karabiner-elements)
  2. click here to add

Alternatively, copy the file here under ~/.config/karabiner/assets/complex_modifications/.

Further reading