I would like to swap the behavior of the two keys Shift and Caps Lock on my keyboard.

I have read the options in /usr/share/X11/xkb/rules/base.lst, played around with'em, but none of them seems to be the exact one I need.

Is this possible? If yes, how should I do?

  • 1
    It is possible if you define a custom option, like here. It's pretty much the same procedure only the first step (the symbols file) is different (you'll have to use replace key). You think you can handle that or do you want me to rewrite it here, tailored to your needs ? – don_crissti Aug 11 '15 at 20:02
  • @don_crissti This looks promising! I'll have a try. – iago-lito 'considering leaving Aug 12 '15 at 7:22

The tools to manipulate the keyboard layout on the virtual consoles are loadkeys, dumpkeys and showkeys. Read their manpages and inform yourself about their intricacies.

Note that these tools only work in a virtual console, not in a terminal emulator in a graphical environment like gnome. The learn about the difference read this question and answers: https://askubuntu.com/questions/14284/why-is-a-virtual-terminal-virtual-and-what-why-where-is-the-real-terminal.

Look at this example:


| improve this answer | |
  • Why not. I'll have a try if creating a new option as suggested by don_crissti doesn't work. Unfortunately, I would like it to work in the graphical environment as well. – iago-lito 'considering leaving Aug 12 '15 at 7:24

On Debian with Gnome you can install gnome-tweak-tool. In the secton "Typing" there are loads of available behaviors for Caps Lock

| improve this answer | |
  • 1
    I guess there are pretty much the same as the ones in base.lst, and unfortunately none of them is the one I need :\ – iago-lito 'considering leaving Aug 12 '15 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.