Repeating keys in XFree86 4.4

knowtree at aloha.com knowtree at aloha.com
Tue Sep 28 13:16:12 PDT 2004


Anybody else having this problem, or know how to fix it?

After upgrading XFree86 to 4.4 (Gnome 2.6.2) I have had problems with my
keyboard. After a few minutes, keys seem to stick, repeating until the next
keystroke. Or, a keypress produces no output. Eventually a key gets stuck
permanently, forcing a reboot.

This never happens in the text mode console, only in X. Just to be sure I
tried two other keyboards, with no improvement. CPU is a Dell GX260

To get any work done at all I have disabled key repeat in the Gnome
keyboard control panel. Awkward, and keys still drop out.

Sounds like a previously reported bug
(http://marc.theaimsgroup.com/?l=xfree86&m=104879558008189&w=2):

I've found the solution to a long-standing problem, which for example
afflicted users of Sawfish WM. Under certain conditions (in fact during a long
enough sync key/board grab), some keys were repeated:


Explanation:
============

1/ XKB-enabled Xfree86 implements key-repeating in software (w/ timers). When a
hardware Key Release arrives, the software timer is canceled.


2/ 
Xfree86 implements key(board) grabs in GrabModeSync by switching a pointer

dev->public.processInputProc

to either
   dev->public.enqueueInputProc  ... events are put in a queue for later
processing
or                     
   dev->public.realInputProc



The problem is, that the public.enqueueInputProc (which is EnqueueEvent() in
xc/programs/Xserver/dix/events.c) does not invoke function
AccessXCancelRepeatKey(), which cancels the timer. 


So, if during Sync grab, key Release is signalled/read from
kernel(hardware), the
timer is not cancelled. Therefore it is run (later), and generates a pair of
Release/Press events, and reschedules itself (so it can result in many
incorrect key
events).



More information about the freebsd-questions mailing list