Comment 1 for bug 367136

Revision history for this message
In , Xarax-fd (xarax-fd) wrote :

After upgrading from Ubuntu 8.10 to 9.04, i.e from Xorg server version 1.5.2 to 1.6.0, I started having problems with 'stuck keys'. I mean a key stuck in autorepeat mode as if the key was being pressed constantly, even if it was released normally. This happened randomly with different applications and different keys, but most often when entering VMWare remote consoles.

When I tried to set autorepeat off, I noticed that in fact the problem is triggered by the command

  $ xset r off

When the command is typed (e.g. in a gnome-terminal or xterm) and Enter pressed, the Enter key starts repeating. A different variation is

  $ read; xset r off

When this command is typed, Enter pressed and then Ctrl-D pressed (to terminate the read), the 'd' key starts repeating. However, if I do

  $ sleep 1; xset r off

no key starts repeating. So it seems that when the autorepeat function is turned off, the last key pressed starts repeating if it was pressed within a sufficiently short interval before turning autorepeat off.

My normal autorepeat setting is delay 500, rate 30. When a key gets stuck and starts repeating, the way I can recover is to set a slow autorepeat rate, typcially I use 'xset r rate 500 3'. Then the next key press stops the repeating. Doing 'xset r off' does not help.

I reported this problem yesterday in Ubuntu's bug tracker under issue #124406, which has a long comment history of possibly related problems with stuck keys. See https://bugs.launchpad.net/ubuntu/jaunty/+source/linux/+bug/124406/comments/235 .