xkb: drop key presses for already repeating keys. (#23889)

The event sequence for continuously pressed keys with the keyboard driver is
PRESS - PRESS - PRESS - ... - RELEASE.
The first press sets the repeatKey to the keycode and the matching timer.
The second press (on the same keycode) can be silently dropped instead of
overwriting the timer again.

X.Org Bug 23889 <http://bugs.freedesktop.org/show_bug.cgi?id=23889>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
Peter Hutterer 2009-09-14 12:00:18 +10:00
parent c626a5578a
commit 4650e6ebe6

View File

@ -524,10 +524,14 @@ KeySym * sym = XkbKeySymsPtr(xkbi->desc,key);
if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,key)) {
if (xkbDebugFlags&0x10)
DebugF("Starting software autorepeat...\n");
xkbi->repeatKey = key;
xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer,
0, ctrls->repeat_delay,
AccessXRepeatKeyExpire, (pointer)keybd);
if (xkbi->repeatKey == key)
ignoreKeyEvent = TRUE;
else {
xkbi->repeatKey = key;
xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer,
0, ctrls->repeat_delay,
AccessXRepeatKeyExpire, (pointer)keybd);
}
}
}
}