Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I saw this question the other day. The user's K key was broken and they wanted to map it to Right-Shift. A good answer popped up and I thought I'd test it to see if it worked. I ran:

xmodmap -e "keycode 62 = k"

I did this under the understanding that I never use Right-Shift for anything. It turns out I was completely wrong. I use it all day long.

I've been filling up documents, corrupting commands, even almost deleting the wrong things (with Right-Shift+Delete). It's been a roller-coaster of emotions, but now I want it to go away. I'm sorry universe.

I know I could reboot or even just restart X but I have a load of things running and work to do. Can I just remove the mapping that xmodmap has created so that Right-Shift is just Right-Shift?

In this case it's just a single mapping (so Etcher Sketch approaches will work for me) but assume I have other mappings that I want to keep.

share|improve this question
Also see – muru Sep 2 '14 at 8:50
up vote 7 down vote accepted


xmodmap -e "keycode 62 = Shift_R"

I used xmodmap -pke to see the list of current mappings, and look up Left-Shift. The right one follows from symmetry.

share|improve this answer
Yup works well, thanks. – Oli Sep 2 '14 at 8:54
@Oli why/Have you not tried xmodmap command again (for selecting Right Shift) yourself? – Pandya Sep 11 '14 at 11:21
@Pandya I wondered if it was a trick question, but then after a few tries I realised that the name for Right Shift might be the problem. Until I ran it with -pke I had guessed R_Shift, RShift, RightShift, etc. – muru Sep 11 '14 at 11:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.