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.

  • Right shift behaves exactly the same as left shift. Keyboard shortcuts may be different. Please edit your question and explain your problem in more detail. – danzel May 19 at 18:43
  • Hmm, it's a very recent installation and it is not behaving equally on this machine. When I press right shift and a letter of choice I still got lower case. Maybe the issue is deeper than just a broken left shift. – snoram May 20 at 7:50
  • If possible, you could try an external keyboard and see if the right shift works there. By the way what exactly is wrong with left shift? – danzel May 20 at 10:03
  • @snoram your question and comment points are confusing.. both the shift keys are damaged or only one shift key is damaged and if single shift, then which shift key is damaged? – PRATAP May 22 at 13:22
  • Sorry @PRATAP. A typo! Left key is physically broken.. will still try to get an external keyboard and report back – snoram May 22 at 13:26

run the command xmodmap -pke | grep Shift


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

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

  • first line of the output from 'xmodmap -pke | grep Shift' is 'keycode 50 = Shift_L NoSymbol Shift_L' when I follow the instructions... right shift seems dead... no response when xev is on... I also tried to copy your command directly as is, but didn't have any effect either. – snoram May 28 at 20:46
  • @snoram thats the problem.. while investigating you clearly mentioned your left shift key is damaged.. now from your above comment Right Shift also not working.. that means your both shift keys are damaged or not working.. so you cannot achieve what you want.. – PRATAP May 29 at 2:01
  • if you copy pasted the code directly.. you can check with this command again xmodmap -pke | grep Shift to see the Right Shift Keycode will show Shift_L keysym.. Anyway its understood that your Leftshift is physically damaged and Right Shift is not physically damaged but its soft dead. – PRATAP May 29 at 2:05
  • probably the only way forward is to get an external keyboard for that machine? – snoram May 29 at 8:06
  • 1
    if you wish you can map any other physical key to Shift_L.. if i am in your place.. i will map it to Menu Key.. – PRATAP May 29 at 8:08

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.