My laptop Down arrow key is stuck on, so I have used Xmodmap to remove the mapping of that key with the following command:

xmodmap .Xmodmap

The contents of my .Xmodmap file is just the single line:

keycode 116 =

All programs in Ubuntu (such as gnome-terminal, xterm, Firefox, gedit) respect this mapping.

However, Google Chrome ignores this mapping, resulting in the page continually scrolling down or the volume being decreased when a full screen video is playing.

Looked at:

Both of which had no available solution.

The solution from https://github.com/dnschneid/crouton/wiki/Keyboard to disable the keyboard layout management with:

gsettings set org.gnome.settings-daemon.plugins.keyboard active false

is not suitable for me as I need to enter Japanese characters so I need the IME to be available to swap between English and Japanese.

  • Chrome developers have known about this since 2014. Safe to say it will never be fixed.
    – Boris
    Sep 28 '20 at 22:59

In issue 394552, one of the user notes that if you set the keymap to be a key that Chromium understands (such as a letter key), it respects the keymap.

Hence, going from the recommendation here, I set the down arrow key to map to the F18 key (which as far I can see, would never be pressed :P). So the contents of my .Xmodmap file is now:

keycode 116 = F18 F18 F18

I have tested with this new keymap and Chrome now seems to be behaving itself, like the other programs.

  • I just tested this again today and this seems to paste the contents of the clipboard into the screen. What is obviously pretty annoying, as it will repeatedly paste indefinitely as the Down arrow key is stuck :( More investigation required :( Oct 27 '15 at 11:48
  • It also worked for me in Chrome, but then in the console it indeed does repeat the F18 key (which for me converts uppercase to lowercase and vice versa). I solved the problem by using 'keycode 116 = Num_Lock NoSymbol NoSymbol', since I dont care if the num lock key is held or not.
    – Sparshong
    Dec 15 '17 at 15:50

This answer solved it for me:

setxkbmap -option lv3:rwin_switch

And then run xmodmap again and restart the application.


Here's how I solved the same issue, and I'm putting it here for anyone with this problem.

I got the answer from here.

From the command line:

    sudo su

Now you have to figure out the scancode of the stuck key.

    showkey -s

Then press the key and it will give two scancodes: press and release. Write those down. Or, since your key is stuck, look for whichever code is repeating itself. For me, the down key comes in two scancode pairs: 0xe0 0x50 (press) and 0xe0 0xd0 (release). You have to abbreviate the scancode pair and use setkeycodes to remap it to a new keycode:

    setkeycodes e050 255
    setkeycodes e0d0 255

That will disable your down arrow key at the kernel level, which should prevent problems in Chrome. Apparently Chrome handles keyboard input somewhat independently of xmodmap and xkb. This was a deliberate change to accommodate how Chrome handles input in ChromeOS. Fortunately, disabling a stuck key at the kernel level stops the problem long before it reaches Chrome. This worked for me to stop a stuck numberpad 9 key from wreaking havoc.

  • unfortunately, this only seems to work on the particular terminal where this command is entered
    – Sparshong
    Dec 15 '17 at 15:45
  • For me this worked in Chrome to disable a key (Up key). And to remap the disabled key, the above answer by kontrollanten worked.
    – rashid
    Jul 12 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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