this laptop is old and my both shift keys and the caps lock key are no longer working. all the other keys are however still working. i dont know what caused this. maybe it is the layout problem or the keyboard circuit is broken. i have tried https://superuser.com/questions/248517/show-keys-pressed-in-linux to see if pressing the keys shows up something. but on pressing shift and caps lock keys, nothing happens.

can i map some other key on the keyboard like say that option-menu key with three horizontal bars to work as my shift. i see so many miscellaneous keys on my keyboard that i dont use, can i use anyone of them for shift keys.

  • I see you used the tag xmodmap so you are aware of it. Did you try to use it? Have you tried something else? May 4, 2020 at 13:45
  • Hi, I solved this problem using xmodmap.
    – rsonx
    May 4, 2020 at 18:43

2 Answers 2


It is not recommended to use a different key for the function of "Shift" or "Caps Lock" keys in case you need the keys you used to replace later (Maybe for troubleshooting or to solve an unexpected issue). Your safest option is to use an external keyboard if possible.

  • ThinkPads don't even have the menu-key that he's suggesting. So reusing that could not be very dangerous. May 4, 2020 at 10:14
  • 1
    @JereKupari If that is the case, his only option will be to use an external keyboard. Obviously he won't have any warranty if his laptop is old.
    – VidathD
    May 4, 2020 at 10:33
  • I don't mean that the OP has a ThinkPad, but that ThinkPads are officially Ubuntu-certified, and don't have the key, so the key must be non-essential. May 4, 2020 at 10:41
  • 1
    @JereKupari Well, still my answer remains the same.
    – VidathD
    May 4, 2020 at 10:45

I mapped my left Shift key to the menu key on my keyboard.

Here is how I did it.

First off all I performed xmodmap -pke > /{desktop_path}/Xmodmap_original to create a backup of my current keymap table.

Note:-pke flag creates a file with keymap table which could be fed back to xmodmap as input, unlike -pk flag.

Then I created a copy of this file cp /{desktop_path}/Xmodmap_original /{desktop_path}/Xmodmap_copy just for the case if I needed the original mappings back.

Since my goal was to give the menu key a new identity as the Shift key, I found it more efficient to modify the saved keymap table.

I opened the Xmodmap_copy file in a text editor and xev program in another terminal.

I used external keyboard to find out the keycode of left Shift key as my laptop's key is not functioning.

I looked up for that keycode in Xmodmap_copy file and copied the expression for it. The expression looked like Shift_L NoSymbol Shift_L.

Then I again used xev to figure out the keycode of the menu key and replaced it's expression with the Shift key's expression.

Saved the file as Xmodmap config file sudo mv Xmodmap_copy /~.Xmodmap. Then fed the config file to xmodmap xmodmap /~.Xmodmap.

Now the menu key acts as a Shift key.

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.