XIfEvent()XIfEvent()NameXIfEvent – wait for event matched in predicate procedure.
Synopsis
XIfEvent(display, event_return, predicate, args)
Display *display;
XEvent *event_return;
Bool (*predicate)();
char *args;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
event_return
Returns the matched event.
predicate Specifies the procedure to be called to determine if the next
event satisfies your criteria.
args Specifies the user-specified arguments to be passed to the
predicate procedure.
DescriptionXIfEvent() checks the event queue for events, uses the user-supplied
routine to check if one meets certain criteria, and removes the match‐
ing event from the input queue. XIfEvent() returns only when the spec‐
ified predicate procedure returns True for an event. The specified
predicate is called once for each event on the queue until a match is
made, and each time an event is added to the queue, with the arguments
display, event_return, and arg.
If no matching events exist on the queue, XIfEvent() flushes the
request buffer and waits for an appropriate event to arrive. Use
XCheckIfEvent() if you don't want to wait for an event.
For more information, see Volume One, Chapter 8, Events.
See AlsoXQLength(), XAllowEvents(), XCheckIfEvent(), XCheckMaskEvent(), XCheck‐
TypedEvent(), XCheckTypedWindowEvent(), XCheckWindowEvent(),
XEventsQueued(), XGetInputFocus(), XGetMotionEvents(), XMaskEvent(),
XNextEvent(), XPeekEvent(), XPeekIfEvent(), XPending(), XPutBack‐
Event(), XSelectInput(), XSendEvent(), XSetInputFocus(), XSynchro‐
nize(), XWindowEvent().
Xlib - Input Handling XIfEvent()