title: flushing events to X11
body: <p>I'm creating an xlib application that sends an alt tab to X11
  I want those events flushed as quickly as possible to send the next combination of keys:</p>
  
  <pre><code>XTestFakeKeyEvent(dis, 64, True, 0);
  XTestFakeKeyEvent(dis, 23, True, 0);
  XTestFakeKeyEvent(dis, 23, False, 0);
  XTestFakeKeyEvent(dis, 64, False, 0);
  XFlush(dis);
  sleep(1);
  XTestFakeKeyEvent(dis, 65, True, 0);
  XTestFakeKeyEvent(dis, 65, False, 0);
  XFlush(dis);
  </code></pre>
  
  <p>I want the first set of keypresses to work BEFORE the second set, unfortunately this does not happen unless I let the application sleep for 1 second between both flushes
  I've tried xsync as well but no dice</p>
  
  <p>thanks</p>