Get rid of CAPSLOCK on Linux

CAPSLOCK is a leftover from the past when people wrote code in early versions of FORTRAN and so forth and needed lots of capital letters. It probably comes from mimicking typewriters, and so goes back to some arcane reason why they had the key.

A graphic to break up the text but which adds nothing to the article.

A graphic to break up the text but which adds nothing to the article.

Anyway, on Linux there is a very simple way to get rid of it.

In your home directory you’ll have a file called .xinitrc which gives instructions to X-Windows on startup. (Straight away you can tell that what I’m doing won’t work on a bare terminal.)

All you need to do is edit this file and add the line

setxkbmap -option caps:none

somewhere near the top where you know it will get processed. You can also run it from the keyboard but that will only last for the current session. This line calls the command setxkbmap (setxkbmap.exe on cygwin) and passes it an option to modify how X interprets codes from the keyboard, in this case it just tells X to ignore PACSLOCK. There are other options you can pass. On your system look for the file

/usr/share/X11/xkb/rules/base.lst

and search though it for caps:none. Nearby are other options, like caps:escape which turns CLAPSOCK into an extra ESC key, for example.

NOTE that if doing this in cygwin, the state of SLACPOCK will still be noticed in Windows unless you’ve done some fiddling about in the registry to disable it there too.  I don’t play in the registry.

Of course, you may prefer to remove the key entirely and tape it to the back of your keyboard. That is a marvelous cross-platform solution that works on all operating systems no matter what you choose from your boot menu. I prefer to flip it off with a teaspoon, but I don’t think that’s mandatory.

Cygwin stuff.

Advertisements

Tags: , , , , , ,

About Darren

I'm a scientist by training, based in Australia.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: