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

My laptop keyboard doesn't have a right Ctrl key. And I use a different layout than the native layout of my keyboard, so there are some keys that do nothing. So I'm trying to remap one of those keys to use as a right control. I'm doing the following command: xmodmap -e 'keycode 97=Control_R'. I also tried with Control_L. But the key do nothing. Then I tested with Alt key: xmodmap -e 'keycode 97=Alt_r' and it works fine.

Why can't I remap the control key?

share|improve this question
up vote 4 down vote accepted

Changing the mapping of the control key is a two step process. The first part is to get the right information for the keycode and keysym. The second part is to make sure the modifier mapping is right.

It sounds like you've got the correct keycode already so try this instead. Create a file myxmodmap with the following

clear control
keycode 97 = Control_R
add control = Control_R Control_L

Now process the file with xmodmap

[~]$ xmodmap myxmodmap

If you want those xmodmap expressions to be processed each time you log in change the file name to ~/.Xmodmap

share|improve this answer

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.