Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 3 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
add comment

Your Answer

 
discard

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.