4

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?

1 Answer 1

7

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

1
  • TIL why everybody keeps recommending kbd :)
    – Nick Bull
    Sep 6, 2020 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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