Ubuntu – How to remap Caps Lock key to Shift Left key

keyboard-layout

I wan't to remap the Caps Lock key to the Shift Left key, so that when I press Caps Lock the functionality of Shift Left is processed. Is there a file in Ubuntu where I can specify this?

I know, under /etc/default/keyboard you can specify some keyboard options, but not this one.

Best Answer

You can use the following command in terminal:

xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L" #this will make Caps Lock to act as Shift_L

To get this change for every session, after you have run the ​​previous commands create a file called .xmodmap with the new keymaps, using the following command:

xmodmap -pke > .xmodmap

Then, create a file called .xinitrc in your home directory, containing the following line/command:

xmodmap .xmodmap