Disable and Enable Caps Lock in Ubuntu
Posted by admin on January 27th, 2007
Email This Post
If you want to disable Caps Lock in Ubuntu you need to type the following command in your terminal
xmodmap -e “clear Lock”
If you want to Enable Caps Lock in Ubuntu you need to type the following command in your terminal
xmodmap -e “add Lock = Caps_Lock”
Solution 2
1) create an appropriate xmodmap-file
xmodmap -pke > ~/.xmodmap.myown
2) Search the line with capslock in it, it’s keycode 66 in my case. Replace it with something you wouls like, my line looks like this
keycode 66 = slash backslash
so You need to slash and backslash on your capslock.
3) make two entries for the xmodmap in autostart
xmodmap -e “clear Lock”
xmodmap ~/.xmodmap.myown
with the first command, the capslock function is disabled, with the second the modified keymap is loaded.
If you want to be notified the next time we write something please subscribe to our RSS feed.Thanks for Visiting!


January 27th, 2007 at 11:23 am
Pardon me for asking, but what possible reason could you have for wanting to disable caps lock???
January 30th, 2007 at 8:51 pm
Hey Admin, why not just use the Keyboard control panel? Layout Options -> Ctrl Key Position. Trivial.
Peter Gasston: Because control is much easier to chord if you move it somewhere where you don’t have to crane your pinky so bad. As it is, the default control position plus emacs is almost a guaranteed recipe for carpal tunnel.
December 9th, 2007 at 1:20 pm
This is very usefull tip. Caps Lock is very annoying button.
It can also be written without another file:
xmodmap -e “clear Lock”
xmodmap -e “keycode 66 = Tab”
(now caps_lock is tabulator too)
July 18th, 2008 at 9:49 am
In a word: Warcraft. But for the times that I’ve failed to attack something then typed:
“sORRY PEOPLE MY KEYBOARD ISN’T COOPERATING.”
AR’s post should eliminate that problem… Will see tonight if ‘t works.
July 23rd, 2008 at 3:21 pm
Jef Raskin in The Humane Interface perfectly stated why the caps lock key should be disabled; it serves almost no function. Few people use it except by accident. Typing in upper-case is generally a temporary mode you want to be in, accomplished by using the shift key. Hitting the caps lock key is almost always a distraction and a loss of productivity. The best purpose the caps lock key can serve is to be mapped to a completely different function.
One time I thought I had found a use for Caps Lock. Typing an XML file, every character needed to be in uppercase according to our specification, but even that wasn’t good. when I needed to write documentation or switch to other applications like email, I’d always forget that Caps Lock was on. In the end, it was easier to just run my files through a tool that converted to uppercase and forget about Caps Lock forever.
September 10th, 2008 at 2:13 am
Thanks for the tip. This is great. I can’t tell you how annoying a find caps lock and insert. The insert key is particularly egregious because I use a small form factor keyboard, and my sausage fingers like to meander down and “press” insert while I am holding shift sometimes.