Skip to main content

Command Palette

Search for a command to run...

Reassigning the Caps Lock Key: A Small Change with Big Impact

Capslock: Control with keys, escape when solo.

Updated
β€’2 min read
Reassigning the Caps Lock Key: A Small Change with Big Impact
D

Hi πŸ‘‹, I'm Dung Huynh Duc A passionate engineer from Singapore

πŸ”­ I’m currently working in AirCarbon

πŸ‘¨β€πŸ’» All of my projects are available at https://productsway.com

πŸ“ I regularly write articles on https://productsway.com

πŸ“« How to reach me dung@productsway.com

πŸ“Ή I often publish my video every Sunday on IT Man Channel

Context

The first time I had the idea to reassign the Caps Lock key to an Escape key was when I worked at a startup in Thailand in 2018. I had no idea whether it was possible or advisable to make that change. It turns out that it was the best decision for me, especially as someone with small hands.

Recently, I've learned one more trick: mapping Caps Lock to Control when holding it with other keys. Wow, it blew my mind.

Why and how

The Caps Lock key is in a good position on the keyboard, but it is also somewhat redundant since Shift + Key achieves the same result. Reassigning it can enhance your typing efficiency.

Mac OSX

To this day, the first thing I do when I get a new laptop is install my go-to application: Karabiner. Then, I go to Complex Modifications.

Image from Gyazo

And add the following rule:

{
  "description": "Change caps_lock to left_control if pressed with other keys, change caps_lock to escape if pressed alone.",
  "manipulators": [
    {
      "from": {
        "key_code": "caps_lock",
        "modifiers": { "optional": ["any"] }
      },
      "to": [
        {
          "hold_down_milliseconds": 400,
          "key_code": "left_control"
        }
      ],
      "to_if_alone": [
        {
          "key_code": "escape",
          "lazy": true
        }
      ],
      "type": "basic"
    }
  ]
}

You can find more useful rules from the community at https://ke-complex-modifications.pqrs.org/

Linux

You can achieve a similar result with Input Remapper by mapping Caps Lock to if_single(key(Escape),hold(Control_L)).

Conclusion

It will take time to remember and get used to the new binding, but you will notice it becomes second nature soon enough.

That's all for today. Happy coding and see you next time.

A little thing

Part 1 of 7

In this series, I will share tips and thoughts to help you maximize your productivity. It's a small thing, but it would be useful for you. :)

Up next

Better naming with AI (Copilot Chat)

Simple prompt to improve your coding experience