3

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.

1

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 :( – crimsonspectre 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
0

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
0

This answer solved it for me:

setxkbmap -option lv3:rwin_switch

And then run xmodmap again and restart the application.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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