mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user