DEV Community

Cover image for Kill the Caps Lock
Toms Burgmanis
Toms Burgmanis

Posted on

Kill the Caps Lock

On modern keyboards the Caps Lock key is undeniably the least useful key.

It was fine on the IBM 84-key keyboard where you had CTRL in its place.
Where did we go so wrong?

It likely has given developers more anger attacks than anything else in existence.

Caps Lock sucks

Yet, despite this, on traditional modern keyboards it is sandwiched right between Tab and Shift keys, some of the most used keys.

Remap the Caps Lock

You should remap the Caps Lock key.

It's horrible.

No one uses it.

Even in situations you think you would use it, you forget about it and you just hold down shift while typing.

The key I've remapped it to is CTRL, due to me being a Vim user, and it being the key most commonly used in shortcuts with Tab / Shift (and to honor the IBM 5170 🖖).

With Caps Lock gone there's no more accidental screaming at your co-workers, and if remapped to CTRL, it is a lot easier to navigate applications with just your keyboard.

Programming oriented keyboards

Most developers already use some super funky mechanical keyboards that feel nice to type on for prolonged periods of time and cost way more than they should, but there's certain keyboard designs that are more specifically designed for developer needs.

One of such keyboards, and my personal favorite, is the Happy Hacking Keyboard (HHKB for short).

HHKB

It is a lot smaller than normal keyboards.

In-fact, it has completely removed the Caps Lock, moved CTRL in its place.
Then those madlads proceeded to remove the entire function key row, along with arrow & a few other keys.

To activate keys such as Caps Lock or function keys, they must be combined with the FN key.

Along with all that, some other, less used keys, are moved around a bit as well.

Sounds dreadful, right? Well, you'd be surprised.

  • Due to CTRL being moved in place of Caps Lock, you will notice that your pinky finger is a lot less strained.

  • Due to the tilde key being moved it leaves more space for the shift key.

  • Due to you having to combine the FN key with / / ; / ' / [ to use arrow keys, you will find that it's a lot quicker and less awkward to use them.

  • Topre switches. There's not many mechanical keyboards who use them, and they feel amazing.

Also, as mentioned before, none of the keys are actually gone, you just need to use FN key in combination with other keys to access them.

There are many more ergonomics & efficiency related reasons why the HHKB keyboard is great for developers, but it's not the only such keyboard.

In-fact, there's different manufacturers who are producing keyboards with the HHKB & similar layouts, such as ai03 keyboards.

Conclusion

Please remap the Caps Lock key.
Please please please.

Are you also advocating for some keyboard? Please share in the comments!

Happy keyboarding ⌨️!

Discussion (23)

Collapse
djuuu profile image
Julien Tardot

It's something I've been doing for some years, now.

However, I did not want to replace it by an existing key, but to use it as a new dedicated modifier (like Ctrl, Alt or the Windows key, but , but not any of these keys).

On Windows

I used AutoHotKey to disable the CapsLock feature, and then define custom shortcuts involving the key:
AutoHotkey.ahk:

;;; Disable CapsLock key
SetCapsLockState, AlwaysOff

;;; [CapsLock] + [D] - print current date
Capslock & d::
    FormatTime, CurrentDateTime,, yyyy-MM-dd
    SendInput %CurrentDateTime%
    return
Return

;;; [CapsLock] + [T] - print current time
Capslock & t::
    FormatTime, CurrentDateTime,, HH:mm:ss
    SendInput %CurrentDateTime%
    return
Return

; ...
Enter fullscreen mode Exit fullscreen mode

On Linux

I use Xmodmap to set the CapsLock key as the "Hyper" modifier, using the "mod3" level (which seems to be mostly unused nowadays)

~/.Xmodmap:

keycode  66 = Hyper_L Hyper_L Hyper_L Hyper_L
clear lock
clear mod3
clear mod4
add mod3 = Hyper_L
add mod4 = Super_L Super_R
Enter fullscreen mode Exit fullscreen mode

I then use AutoKey to define shortcuts based on the Hyper modifier.

This way, a can define my own system-wide shortcuts, knowing that they will virtually never conflict with any application.

Collapse
ximias profile image
Alex Holberg

Keys in order of uselessness:
Scroll lock
Num lock (always locked anyway)
Printscreen
Pause
Insert
Right win-key
Caps lock

Collapse
jhilgeman profile image
Jonathan H

I use all of those.

Scroll Lock - Useful by different apps, like Excel (allows scrolling with arrow keys without changing the active cell) or Synergy (temporarily lock to current screen).

Num lock - Useful if you use the number pad for both numeric input and also navigation (e.g. arrow keys, page up/down, etc, all in one physical area).

Print screen - Shortcut for taking screenshots in Windows, and is often taken over by screenshotting tools like Snagit.

Pause - Useful in some apps, although the Break key is a little more useful.

Insert - Pretty sure anyone who does a lot of text editing would say Insert is not useless.

Right win-key - I agree here but it seems like more and more keyboards don't have one of these. I have multiple laptops and different keyboards from the past decade, and only one or two have this key anymore.

Caps lock - Also useful by certain apps. Not quite as regularly-useful as the other "lock" keys, but still occasionally useful.

Collapse
ximias profile image
Alex Holberg

I'm not arguing that they are as useless as not having a button on the keyboard (except NumLock), just that they are more useless than caps lock. To me anyway 😉

For a lot of those, you had to come up with applications that has bound them to something (similar to regular Function keys) Synergy, probably uses scroll lock because of its uselessness in other apps, I applaud their creativity. Personally, I use them about as much as Function keys.

Print screen I have miss-clicked more than intentionally used it, because my laptop replaced right win key with it. (I use the built-in snipping tool in Windows)

I used Pause on a .bat script once.
Oh, and in Age Of Empires to pause the game!

Now, I have a pet peeve with numlock, so that is going to be the hill that I die on here.
If you have a numpad, do you not also have the navigation keys literally next to the numpad? And arrow keys just below?
Why then would you blindly copy the exact same buttons in very close proximity?
Additionally, who decided that it should be off by default and cause me all sorts of misery? I get that there are number keys on my keyboard already, but i don't really use those for anything other than symbols anyway.
I would unbind NumLock in a heartbeat, if I could. (And didn't have to press it every time my PC/VM boots)
I've tried to install software and do registry tweaks to keep it enabled, but is behaves oddly.
TL;DR: There is no single button that has caused me more frustration than NumLock.

Oh, and for insert, it needs to have an indicator light, or get moved further away, where I don't fat-finger it without noticing 😆

Thread Thread
maxdevjs profile image
maxdevjs

Out of curiosity, what is your laptop...?

Thread Thread
ximias profile image
Alex Holberg

Some Lenovo ThinkPad.
It is provided through work, so I don't remember which one 😅

Collapse
redcreator37 profile image
RedCreator37

I'm using a full PC keyboard on a Mac and I usually remap the "switch keyboard layout" shortcut to Pause. It's much better than the default ⌃Space, which conflicts with IntelliJ's suggestions drop-down. MacOS detects those three keys (Printscreen, Scroll lock and Pause) as F13, F14 and F15 which seems somewhat interesting to me.

Collapse
lase profile image
Matt Laser

WHILE I APPRECIATE YOUR PERSPECTIVE, THE ENTIRE POST FAILS IN THAT IT CENTERS REMAPPING KEYS BASED ON THEIR UTILITY. IF YOU HONESTLY FELT THIS WAY, YOU'D HAVE MUCH MORE ADVANCED KEYMAPPINGS, AND LIKELY A DIFFERENT KEYBOARD THAT A HHKB (STRANGELY, I'VE NEVER HEARD OF THAT KEYBOARD, THE NAME BETRAYING IT AS A POTENTIAL GIMMICK RATHER THAN SOMETHING OF GREATER QUALITY IN THE WIDE & DEEP WORLD OF MECHANICAL KEYBOARDS).

PERSONALLY, I RUN CTRL ON BOTH LONG PRESSES OF F AND J SO I'M NEVER LEAVING THE HOME ROW TO EXECUTE THE MOST COMMON FUNCTIONS. - IS ON A TAP OF RIGHT SHIFT, AND { AND } BOTH EARNED THEMSELVES DEDICATED KEYS. HOWEVER, I DIGRESS - THIS ISN'T RELEVANT TO THE TOPIC AT HAND.

CAPS LOCK IS THE ONLY IRREPLACEABLE KEY THANKS TO THE WAY ASCII WORKS. IF YOU FEEL DEVELOPING A STRESS INJURY HOLDING DOWN SHIFT WITH A PINKY, I CAN'T STOP YOU, BUT I WOULD ADVISE AGAINST IT. YOU YOURSELF MENTION THAT YOU'RE SUPPOSEDLY SAVING PINKY STRENGTH WITH THIS NEW LAYOUT, BUT JUST WAIT UNTIL YOU HAVE TO TYPE A LOT OF CAPITAL LETTERS IN A ROW!

FINALLY, CAPS LOCK IS AN EXTRA KEYBIND FOR GAMING, PROBABLY ITS MOST IMPORTANT USE. FOOD FOR THOUGHT.

CHEERS

Collapse
vbjelak profile image
Vladi Beeblebrox

why yelling, who made you angry? caps got stuck after reading the article? 🤭

Collapse
mrbeanguy profile image
Bean

Their was no need to use all caps...

Collapse
brandonwallace profile image
brandon_wallace

I disable the CAPS LOCK key on Linux like this.

# Disable the caps lock key.
setxkbmap -option ctrl:nocaps
Enter fullscreen mode Exit fullscreen mode
Collapse
vier31 profile image
Jan Schröder

ESC 4 live.

Also, CTRL + Space to switch language layout.

Collapse
hb profile image
Henry Boisdequin

I agree!

Collapse
llldar profile image
Nathaniel

I use filco minila air, much better than HHKB imo.

Collapse
pontakornth profile image
pontakornth

Remapping caplock to backspace is also a good choice.

Collapse
cantnopwontnop profile image
NOP

Agreed, I prefer a delete key for forward deleting.

I have set up keybindings in my IDEs and spreadsheet programs to delete an entire line/row with shift+delete.

Collapse
jonrandy profile image
Jon Randy

I remap it to swap keyboard languages (English -> Thai)

Collapse
pontakornth profile image
pontakornth

Wow, same here. It's less frustrating when you need one key to swap language. And I can still hold it key for caplock (For yelling, SQL, and docker files).

Collapse
brandonwallace profile image
brandon_wallace • Edited on

I have been typing on keyboards since the internet was born. I have never pressed the CAPS LOCK key. I always wondered why they invented it. Just joking, I am not that old.

Collapse
dimadk24 profile image
Dima Krutolianov

If you use several keyboard layouts, it's very convenient to use Caps Lock for switching them. I'm using it for several years and really like such way of switching keyboard layout

Collapse
mellen profile image
Matt Ellen

Yes, get rid of capslock. Replace it with shiftlock.

Collapse
joinemm profile image
Joonas • Edited on

I've remapped my caps lock to windows key. Makes moving around in my tiling window manager so much easier as all the shortcuts use the windows key