+ map<WindowHandle, Window *>::iterator j=priv->windows.find(event.xevent.xany.window);
+ if(j!=priv->windows.end())
+ {
+ /* Filter keyboard autorepeat. If this packet is a KeyRelease and
+ the next one is a KeyPress with the exact same parameters, they
+ indicate autorepeat and must be dropped. */
+ if(event.xevent.type==KeyRelease && !j->second->get_keyboard_autorepeat() && pending>0)
+ {
+ XKeyEvent &kev=event.xevent.xkey;
+ XEvent ev2;
+ XPeekEvent(priv->display, &ev2);
+ if(ev2.type==KeyPress)
+ {
+ XKeyEvent &kev2=ev2.xkey;
+ if(kev2.window==kev.window && kev2.time==kev.time && kev2.keycode==kev.keycode)
+ {
+ XNextEvent(priv->display, &ev2);
+ --pending;
+ continue;
+ }
+ }
+ }
+