+ if(ignore_key_repeat && XEventsQueued(dpy, QueuedAfterReading)) {
+ XEvent next;
+ XPeekEvent(dpy, &next);
+
+ if(next.type == KeyPress && next.xkey.keycode == ev->xkey.keycode &&
+ next.xkey.time == ev->xkey.time) {
+ /* this is a key-repeat event, ignore the release and consume
+ * the following press
+ */
+ XNextEvent(dpy, &next);
+ break;
+ }
+ }
+ }