summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-06-26 10:30:35 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-05 17:36:07 +1000
commit73bd33b4d4e3df4a8097826695a8dbdc2fb5c920 (patch)
treedec07eda8ee3bc13807e49f96aeb3555f67c3b43 /xkb
parent2def985466683cf3746c03f9ac318e5941d22f86 (diff)
xkb: fill in keycode and event type for slow keys enablement
eventType is set for the type that triggered a XkbControlsNotify event. Technically, SlowKeys is triggered by a timer which doesn't have a matching core event type. So we used to use 0 here. Practically, the timer is triggered by a key press + hold and cancelled when the key is released before the timeout expires. So we might as well set KeyPress (keycode) in the ControlsNotify to give clients a chance to differ between timer-triggered SlowKeys and client-triggered ones. This is a chance in behaviour, though I suspect with little impact. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Acked-by: Daniel Stone <daniel@fooishbar.org> (cherry picked from commit 2c4388a00ec308bc2d48ba751ff510cd5c1b2384)
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkbAccessX.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index c1af32eb9..21df85d94 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -291,8 +291,8 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
return 4000;
}
xkbi->krgTimerActive = _OFF_TIMER;
- cn.keycode = 0;
- cn.eventType = 0;
+ cn.keycode = xkbi->slowKeyEnableKey;
+ cn.eventType = KeyPress;
cn.requestMajor = 0;
cn.requestMinor = 0;
if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask) {
@@ -304,6 +304,7 @@ AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg)
LogMessage(X_INFO, "XKB SlowKeys are now enabled. Hold shift to disable.\n");
}
+ xkbi->slowKeyEnableKey = 0;
return 0;
}
@@ -462,6 +463,7 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd)
if (ctrls->enabled_ctrls & XkbAccessXKeysMask) {
/* check for magic sequences */
if ((sym[0] == XK_Shift_R) || (sym[0] == XK_Shift_L)) {
+ xkbi->slowKeyEnableKey = key;
if (XkbAX_NeedFeedback(ctrls, XkbAX_SlowWarnFBMask)) {
xkbi->krgTimerActive = _KRG_WARN_TIMER;
xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 4000,