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?

Justin
  • 154

2 Answers2

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

ændrük
  • 76,794
  • 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 '11 at 17:35
  • After every reboot? Use @reboot for the numbers in /etc/crontab and put the command. – JMCF125 Oct 14 '13 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 '16 at 13:22
-3

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

xmodmap -e "remove lock = Caps_Lock"
Wesley Rice
  • 13,466