Ubuntu Remap keys in the keyboard
Left Shift key on my keyboard started acting up. It some times work, some times it won’t. I never use the caps lock key on my kayboard, this is just above the shift key. So i decided to use this key as left shift key.
To re-assign key, you need to edit file /usr/share/X11/xkb/symbols/pc
Lets take a copy of the file before we edit it
1 |
cp /usr/share/X11/xkb/symbols/pc ~/pc-backup |
Edit
1 |
sudo gedit /usr/share/X11/xkb/symbols/pc |
Find the line
1 |
key <CAPS> { [ Caps_Lock ] }; |
This is on line 22
Replace with
1 |
key <CAPS> { [ Shift_L ] }; |
Now you need to restart X-Windows by pressing ALT+F2, then type r. You can also just reboot your computer for the new keymap to work. After restart, i can use Caps lock key as my Left Shift key.
If you want to disable left shift key, you can comment the line
1 |
key <LFSH> { [ Shift_L ] }; |
by adding // at beginning of the line.
See Ubuntu