5

I have disabled caps lock in Ubuntu via the System Settings -> Keyboard panel (see How to programmatically swap the caps lock and esc keys? on how to find this option), however when I switch to a text-mode tty terminals (through Ctrl + Alt + F1) caps lock is no longer disabled.

I use these text-based terminals a fair amount - is there a way to completely disable Caps Lock, even on these terminals?

2 Answers 2

11

I had success using the instructions posted on this blog in a virtual console:

echo -e "$(dumpkeys | grep ^keymaps)\nkeycode 58 = Escape" | sudo loadkeys

I'm not sure how to apply this automatically after every reboot, though.


While researching your question, I also ran across this alternative solution:

Disable Caps Lock

3
  • I honestly have no idea what that command did, but it worked! At some point I'll have to work my way through that blog post and understand it, but for now thanks!
    – Justin
    May 20, 2011 at 17:35
  • After every reboot? Use @reboot for the numbers in /etc/crontab and put the command.
    – JMCF125
    Oct 14, 2013 at 21:28
  • I had to replace grep ^keymaps by grep -i keymaps as in the original blog post. But then I decided to just replace the key definition in my keymap in /usr/share/kbd/keymaps/ (using a custom keymap anyway). Also: +1 for the alternative solution :D
    – Thomas G.
    May 18, 2016 at 13:22
-3

Adding the following line to .profile or .bash_profile should disable caps lock:

xmodmap -e "remove lock = Caps_Lock"
4
  • 3
    How do you use xmodmap when you're not running an X server?
    – ændrük
    May 20, 2011 at 18:08
  • I would assume Kragen is running an X server, since they mentioned GNOME's System Settings panel. May 21, 2011 at 0:46
  • In a typical Ubuntu installation, X does not run in the tty1 virtual console.
    – ændrük
    May 21, 2011 at 4:06
  • I tried this [in X, ubuntu 11.04] and it's not working. did they change it?
    – Matt
    Dec 19, 2011 at 1:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .