15

My control key on the right doesn't work how it should. E.g. Right ctrl + T won't open new tabs in firefox, right ctrl + w won't switch windows in vim, etc.

I know the key isn't physically broken, because xev shows that the right ctrl key generates events, but it just isn't responding as I expect it to in applications.

enter image description here

I tried Kim's answer but it still doesn't work.

blaine@blaine-laptop ~ $ xmodmap -pke | grep 105
keycode 105 = Control_R Control_R Control_R Control_R Control_R

Tried to map as Control_L as well, didn't work.


The computer is a laptop, I am unable to plug the keyboard in to another computer.

Gareth
  • 19,080

9 Answers9

15

I have the same problem in gnome while running VMWare & I fix it by running the following:

setxkbmap
10

Use

 xev | grep -i keyrelease -A5

and press right ctrl to find its key code. Let's say it is 105, as on my keyboard. Then see what

xmodmap -pke | grep 105

tells us. It should be something like that:

keycode 105 = Control_R NoSymbol Control_R NoSymbol Control_R

If it isn't, you can change it with:

xmodmap -e 'keycode 105 = Control_R NoSymbol Control_R NoSymbol Control_R'

See whether it works now. If so, put this line into a script and add the script to your startup applications.

Kim
  • 2,418
4

You probably need to fix your modifier mappings.

Do a

 xmodmap -pke > my.xmodmap

Use xev to check the scancodes of your control keys, and make sure they're set correctly in that file.

e.g. for me:

 ...
 keycode  37 = Control_L NoSymbol Control_L NoSymbol Control_L
 ...
 keycode 117 = Control_R NoSymbol Control_R NoSymbol Control_R
 ...

At the end of this file, add:

 clear Control
 add Control = Control_L Control_R

(btw, you can see your modifiers by running 'xmodmap' with no arguments.)

Then feed-back the modified mapping file:

 xmodmap my.xmodmap
bryce
  • 41
1

Had the same issue, went to the GNOME tweak tool; under Keyboard & Mouse make sure "Emacs Input" is disabled.

1

I had the same issue running GNOME Shell; it was most obvious running mono apps and some games (such as Kerbal Space Program, which uses the left Ctrl).

I resolved it using GNOME tweak tool; under Keyboard & Mouse make sure "Show location of pointer" is disabled.

STW
  • 1,908
0

I had same problem with Ctrl not working in Firefox. Here's what fixed it for me: Go to Compiz->General->General Options->Key bindings. If any combinations include Ctrl, change to something else, such as Shift.

Kazark
  • 3,509
0

Open Tweaks-> Keyboard and Mouse -> Compose Key. make sure the right or left ctrl button is not a compose key. Any under button like PrtScn can be set to a compose key and both ctrl buttons should start working before.

0

I have not Right CTRL on my keyboard, but instead of it i have Insert key. I run xev and press Insert. I see that Insert generate keycode 106.

Now, to map my Insert key (keycode 106) to Right CTRL i do something like below and works (for example Ctrl+T in Google Chrome). Maybe that will help You.

xmodmap -e 'keycode 106 = Control_R' -e 'clear Control' -e 'add Control = Control_L Control_R'

I put this lines into my ~/.xinitrc and ~/.xsession to setup remapping on X startup.

marioosh
  • 3,651
0

Hit 'layout options' in the screenshot you posted. Is anything bold? is there anything checked for right control under of the settings?

user23307
  • 7,127