XIfEvent(3X) XIfEvent(3X)NAME XIfEvent, XCheckIfEvent, XPeekIfEvent - check the event queue with a predicate procedure SYNOPSIS XIfEvent (display, event-return, predicate, arg) Display *display; XEvent *event-return; Bool (*predicate) (); char *arg; Bool XCheckIfEvent (display, event-return, predicate, arg) Display *display; XEvent *event-return; Bool (*predicate) (); char *arg; XPeekIfEvent (display, event-return, predicate, arg) Display *display; XEvent *event-return; Bool (*predicate) (); char *arg; DESCRIPTION The XIfEvent function checks the event queue for the speci- fied event and completes only when the specified predicate procedure returns TRUE for an event, which indicates an event in the queue matches. XIfEvent flushes the output buffer if it blocks waiting for additional events. XIfEvent removes the matching event from the queue and copies the structure into the client-supplied XEvent structure. The XCheckIfEvent function checks the event queue for the specified event. When the predicate procedure finds a match, XCheckIfEvent copies the matched event into the client-supplied XEvent structure, returns nonzero (TRUE) and removes the event from the queue. If the predicate pro- cedure finds no match, XCheckIfEvent returns FALSE, and the output buffer is flushed. All earlier events stored in the queue are not discarded. The XPeekIfEvent function returns only when the specified predicate procedure returns nonzero (TRUE) for the next event in the queue that matches the specified event. After the predicate procedure finds a match, XPeekIfEvent copies the matched event into the client-supplied XEvent structure without removing the event from the queue. XPeekIfEvent flushes the output buffer if it blocks waiting for addition- al events. November, 1990 1
XIfEvent(3X) XIfEvent(3X)Arguments These functions accept the following arguments: arg Specifies the user-supplied argument that will be passed to the predicate procedure. display Specifies the connection to the X server. event-return Specifies a structure into which the matched event's associated structure is copied. predicate Specifies the procedure that is to be called to determine if the next event in the queue matches the one specified by the event argument. SEE ALSO XAnyEvent(3X), XNextEvent(3X), XPutBackEvent(3X), XSendEvent(3X)Xlib - C Language Interface2 November, 1990