How to remap Caps Lock key to Shift Left key?

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.


Solution 1:

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

Solution 2:

enter in terminal: xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L"

To use the command after restart or shutdown, you can put it in Startup Applications Preferences. Tested on my Ubuntu 18.04.