NAME
XEventsQueued − check the number of events in the event queue.
Synopsis
int XEventsQueued(display, mode)
Display *display;
int mode;
Arguments
displaySpecifies a connection to a Display structure, returned from XOpenDisplay().
modeSpecifies whether the request buffer is flushed if there are no events in Xlib’s queue. You can specify one of these constants: QueuedAlready, QueuedAfterFlush, QueuedAfterReading.
Description
XEventsQueued() checks whether events are queued. If there are events in Xlib’s queue, the routine returns immediately to the calling routine. Its return value is the number of events regardless of mode. mode specifies what happens if no events are found on Xlib’s queue.
•If mode is QueuedAlready, and there are no events in the queue, XEventsQueued() returns zero (it does not flush the request buffer or attempt to read more events from the connection).
•If mode is QueuedAfterFlush, and there are no events in the queue, XEventsQueued() flushes the request buffer, attempts to read more events out of the application’s connection, and returns the number read.
•If mode is QueuedAfterReading, and there are no events in the queue, XEventsQueued() attempts to read more events out of the application’s connection without flushing the request buffer and returns the number read. Note that XEventsQueued() always returns immediately without I/O if there are events already in the queue. XEventsQueued() with mode QueuedAfterFlush is identical in behavior to XPending(). XEventsQueued() with mode QueuedAlready is identical to the QLength() macro (see Appendix C, Macros). For more information, see Volume One, Chapter 8, Events.
See Also
QLength(), XAllowEvents(), XCheckIfEvent(), XCheckMaskEvent(), XCheckTypedEvent(), XCheckTypedWindowEvent(), XCheckWindowEvent(), XGetInputFocus(), XGetMotionEvents(), XIfEvent(), XMaskEvent(), XNextEvent(), XPeekEvent(), XPeekIfEvent(), XPending(), XPutBackEvent(), XSelectInput(), XSendEvent(), XSetInputFocus(), XSynchronize(), XWindowEvent.
Copyright O’Reilly & Assoc. —