summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/xkbsrv.h6
-rw-r--r--xkb/xkbAccessX.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 7e71089f1..6e4ad44d4 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -142,6 +142,10 @@ typedef struct _XkbFilter {
struct _XkbFilter *next;
} XkbFilterRec, *XkbFilterPtr;
+typedef Bool (*XkbSrvCheckRepeatPtr) (DeviceIntPtr dev,
+ struct _XkbSrvInfo * /* xkbi */ ,
+ unsigned /* keycode */);
+
typedef struct _XkbSrvInfo {
XkbStateRec prev_state;
XkbStateRec state;
@@ -189,6 +193,8 @@ typedef struct _XkbSrvInfo {
int szFilters;
XkbFilterPtr filters;
+
+ XkbSrvCheckRepeatPtr checkRepeat;
} XkbSrvInfoRec, *XkbSrvInfoPtr;
#define XkbSLI_IsDefault (1L<<0)
diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c
index 892cb3097..f80057747 100644
--- a/xkb/xkbAccessX.c
+++ b/xkb/xkbAccessX.c
@@ -89,6 +89,7 @@ AccessXInit(DeviceIntPtr keybd)
xkbi->repeatKeyTimer = NULL;
xkbi->krgTimer = NULL;
xkbi->beepTimer = NULL;
+ xkbi->checkRepeat = NULL;
ctrls->repeat_delay = XkbDfltRepeatDelay;
ctrls->repeat_interval = XkbDfltRepeatInterval;
ctrls->debounce_delay = 300;
@@ -317,7 +318,8 @@ AccessXRepeatKeyExpire(OsTimerPtr timer, CARD32 now, void *arg)
if (xkbi->repeatKey == 0)
return 0;
- AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE);
+ if (xkbi->checkRepeat == NULL || xkbi->checkRepeat (dev, xkbi, xkbi->repeatKey))
+ AccessXKeyboardEvent(dev, ET_KeyPress, xkbi->repeatKey, TRUE);
return xkbi->desc->ctrls->repeat_interval;
}