Bool XCheckIfEvent(display, event_return, predicate, arg)
|| Specifies the connection to the X server.
|| Returns a copy of the matched event's associated structure.
|| Specifies the procedure that is to be called to determine
if the next event in the queue matches what you want.
|| Specifies the user-supplied argument that will be passed to the predicate procedure.
When the predicate procedure finds a match,
copies the matched event into the client-supplied
structure and returns
(This event is removed from the queue.)
If the predicate procedure finds no match,
and the output buffer will have been flushed.
All earlier events stored in the queue are not discarded.
"Selecting Events Using a Predicate Procedure".
Christophe Tronche, email@example.com