diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-14 12:00:18 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-14 12:54:27 +1000 |
commit | 4650e6ebe6e3ea48a026ace60b25daa165580467 (patch) | |
tree | 3165654f83c05e0f5d7d180d946cb9459bc18685 /xkb | |
parent | c626a5578aa16c17ef68c1b15ed53828080d9d90 (diff) |
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>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/xkbAccessX.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 47023c048..fd30a1ce7 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -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); + } } } } |