My control key doesn't work, how do I fix it?

9

4

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.

Blaine Lafreniere

Posted 2009-12-29T04:48:54.563

Reputation: 243

Gnome, I assume? and what are your current keyboard settings? – John T – 2009-12-29T04:56:07.153

Yes, Gnome. I'm using Ubuntu 9.10. See the screenshot I added for keyboard settings. – Blaine Lafreniere – 2009-12-29T05:00:33.683

Does it work if you plug it into a different computer? Does another keyboard work on your computer? – Daniel H – 2010-01-01T22:51:25.143

It's a laptop, I can't plug it in another computer – Blaine Lafreniere – 2010-01-02T19:00:13.680

Answers

11

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

setxkbmap

Stephen Burke

Posted 2009-12-29T04:48:54.563

Reputation: 131

I don't know what this command does but it worked for me! Installing VMWare does somthing to your keymap. However I have to do this everytime I switch back from VMWare :( – Autodidact – 2015-05-19T10:54:19.780

Worked for me too. If your Ctrl key stops registering while or after using VMware Player, you need to run setxkbmap without any parameters. – RAKK – 2016-07-25T14:46:22.790

7

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

Posted 2009-12-29T04:48:54.563

Reputation: 2 238

I've tried that, but it's still not responding as it should. Ctrl+T yields nothing in firefox, and ctrl+shift+T yields nothing in terminal. xmodmap -pke | grep 105 does show that it's mapped to Control_R, though, but it's just not behaving as I thought it would. Is there some kind of re-initializing I need to do? e.g. new fonts require fc-cache -f -v in order to be recognized. – Blaine Lafreniere – 2009-12-30T11:30:38.333

Are you just having trouble with certain key combos and the key works fine otherwise? Or doesn't it work at all? If the former, it might be that you have compiz keyboard shortcuts configured for Control_R T and Conntrol_R Shift T and compiz takes precedence over firefox and gnome-terminal. – Kim – 2009-12-31T07:12:07.260

It doesn't appear to work at all except in xev. No key combination that requires ctrl will work with right ctrl, but all key combinations that require ctrl will work with left ctrl. – Blaine Lafreniere – 2010-01-01T07:55:51.570

I've tried turning advanced effects to none in compiz manager, same problem. – Blaine Lafreniere – 2010-01-01T08:24:49.967

As a last resort I'd try setting it to Control_L instead. – Kim – 2010-01-01T09:30:08.353

Still not working ): – Blaine Lafreniere – 2010-01-01T09:53:16.963

3

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

user30237

Posted 2009-12-29T04:48:54.563

Reputation: 31

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.

Wayne Twine

Posted 2009-12-29T04:48:54.563

Reputation: 1

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

Posted 2009-12-29T04:48:54.563

Reputation: 2 921

0

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

Posted 2009-12-29T04:48:54.563

Reputation: 1 676

0

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

user23307

Posted 2009-12-29T04:48:54.563

Reputation: 5 915

There's only one section in bold, and the only option that is checked is alt+capslock to change my keyboard's layout from Germany to USA – Blaine Lafreniere – 2010-01-04T23:31:52.030

Germany? did you look under all the settings in that window? I bet you have right control acting as alt_gr or compose or whatever that ke is called. – user23307 – 2010-01-05T02:01:20.047