+
+ if(key_buffering == KeyBufferingAwaitingFocus) {
+ key_buffering = KeyBufferingOff;
+ // there's a few ways to release the grab, with different effects (below)
+ // In this example F2 is mapped to kbspawn
+ // XAllowEvents(dpy, AsyncKeyboard, CurrentTime);
+ // swallows key presses while F2 is still down.
+ // XAllowEvents(dpy, ReplayKeyboard, CurrentTime);
+ // sends the F2 keydown and all the queued events
+ // XUngrabKeyboard(dpy, CurrentTime);
+ // sends everything queued and the F2 key_UP_
+ XUngrabKeyboard(dpy, CurrentTime);
+ }