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-11-29 14:48:54 +1000
commit2c4388a00ec308bc2d48ba751ff510cd5c1b2384 (patch)
tree2c131b933b5dbb350b268b85213582331a28ae94 /xkb
parent2dc6d9228456cbc274a1fcea478258e5ae4dc629 (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>
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,