Caps Lock to Control Key in Ubuntu

I like to remap my caps lock key to an extra control key (this can be common practice in the emacs world).  It’s closer to the common keys that are paired with control.  And besides, I only ever turn on caps lock by mistake. 

Recently, while installing Ubuntu on a box, I was looking for the way to do this.  I found a piece of code that remaps the key with calls to xmodmap.  You put the snippet in your ~/.profile file.  It worked, sort of.  I would get errors about the script when logging in via ssh remotely.  (There are ways to script around that).  And bouncing back and forth from a local screen to connecting via vnc would sometimes remove the setting. 

Instead of finding ways around those issues, I found “the way”.  Just go in to your preferences menu and to the keyboard.  Under control key, there is an option to make the caps lock and additional control key.  It doesn’t affect remote connections (the ssh client uses the local key mapping).   And the setting never seems to get lost.


Posted

in

by