Map the right shift button to the left shift button

Left Shift button on the keyboard is (physically) broken and doesn't respond, and switching to upper case letters has to be done with Caps Lock, and special characters such as question marks have to copied from somewhere.

Would there be a way to define the right shift button to have the exact same function as the left Shift button?

Using a Sony Vaio laptop and Ubuntu 18.04.

10

1 Answer

run the command xmodmap -pke | grep Shift

example:

parrot@i7-4770U:~$ xmodmap -pke | grep Shift
keycode 50 = Shift_L ISO_Next_Group Shift_L ISO_Next_Group Shift_L ISO_Next_Group Shift_L ISO_Next_Group
keycode 62 = Shift_R ISO_Next_Group Shift_R ISO_Next_Group Shift_R ISO_Next_Group Shift_R ISO_Next_Group
keycode 92 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift NoSymbol ISO_Level3_Shift
keycode 108 = Alt_R ISO_Next_Group ISO_Level3_Shift NoSymbol ISO_Level3_Shift
parrot@i7-4770U:~$ 

Copy the Shift_L part completely like this

Shift_L ISO_Next_Group Shift_L ISO_Next_Group Shift_L ISO_Next_Group Shift_L ISO_Next_Group

run the command to map keycode 62 to use Left Shift functionality

xmodmap -e "keycode 62 = Shift_L ISO_Next_Group Shift_L ISO_Next_Group Shift_L ISO_Next_Group Shift_L ISO_Next_Group"

run the command xev and press physical key Right Shift.. you will see the symbol as Shift_L

Example Output with xev and pressing physical Right Shift key

KeyRelease event, serial 37, synthetic NO, window 0x3600001, root 0x116, subw 0x0, time 490059, (660,717), root:(748,835), state 0x1, keycode 62 (keysym 0xffe1, Shift_L), same_screen YES, XKeysymToKeycode returns keycode: 50 XLookupString gives 0 bytes: XFilterEvent returns: False

if you are satisfied with the behaviour of this functionality..

make the command as a startup application preferences like this

enter image description here

5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like