Photo by Rahul Chakraborty on Unsplash
Reassigning the Caps Lock Key: A Small Change with Big Impact
Capslock: Control with keys, escape when solo.
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
.
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.