After almost 15 years of programming life, I always want to swap the
Caps Lock with my keyboard. I began to do so because I need to use Emacs , and
Control is the most used key in many key bindings in Emacs. I started to experienced Repeated Strain Injury after several years of working, swap these two keys saved me.
Not only in Emacs, we actually use
Control much much more than
Caps Lock, but
Caps Lock is usually put in a better position in most keyboard layouts. This standard keyboard layout began almost at 1984, when IBM PC keyboard introduced Model F (PC/AT).
HHKB is an alternative if you want a keyboard with a default layout that prefers to programmers. If you are a Vim/Emacs user, buy one for yourself!
It’s also easy if you want to swap these two keys.
The easiest way is installing PowerToys, and config it in Keyboard Manager:
Remember to keep
PowerToys run in administrator mode.
There are some other ways such as using
regedit to modify, but I haven’t tried it.
Go to Apple Menu -> System Preferences… -> Keyboard -> Keyboard Tab -> Modifier Keys and select
When running XWindows you need to modify the X11 key map using xmodmap. It is not sufficient to just modify the console keyboard mapping. Use xmodmap to load the following keymap file (save in ~/.Xmodmap):
make these changes persistent
These keyboard settings are not persistent after a reboot. Most Linuxes will load your ~/.Xmodmap file when you log in with xdm or gdm. Some don’t. If not then you should add this line to your ~/.xsession and ~/.xinitrc files (after the shebang #!/bin/sh line):
If you are using GNOME, try to install Gnome Tweak Tool:
For version 3.30.0 and later:
- Open the tweak-tool and click on the Keyboard & Mouse section in the left menu bar.
- Click on the Additional Layout Options button on the left.
- Under Caps Lock behavior select Caps Lock is also a Ctrl.
For older versions:
- Open the tweak-tool and click on the typing section in the left column.
- You should now see the line Caps Lock key behavior on the left.
- Choose Make CapsLock an additional Ctrl key instead of Disabled in the drop-down list and you should be good.
Enjoy your new