XtAppPeekEvent()XtAppPeekEvent()NameXtAppPeekEvent - return, but do not remove the event at the head of an
application's input queue; block if no events are available.
Synopsis
Boolean XtAppPeekEvent(app_context, event_return)
XtAppContext app_context;
XEvent *event_return;
Inputs
app_context
Specifies the application context.
Outputs
event_return
Returns the event from the head of the queue, if that event
is an X event.
Returns
True if the event at the head of the queue is an X event; False if it
is a timer event or an alternate input source event.
Description
If there are X events pending on any of the displays in app_context,
XtAppPeekEvent() copies the event from the head of the application
event queue into event_return (without removing the event from the
queue) and returns True. If there are no events, it flushes the output
buffers of each display and checks again. If there are still no pend‐
ing X events on any of the displays, but there are timer or alternate
input events ready, XtAppPeekEvent() returns False.
If there are no events of any kind, XtAppPeekEvent() blocks until one
occurs, and then if it is an X event, copies the event (without remov‐
ing it from the queue) and returns True or returns False otherwise.
Note that XtAppPeekEvent() never calls background work procedures reg‐
istered with XtAppAddWorkProc() .
Usage
Programs rarely need this much control over the event dispatching mech‐
anism. Most programs use XtAppMainLoop().
If you want to get X events and remove them from the input queue, con‐
sider XtAppNextEvent(). This function also dispatches timer and alter‐
nate input events.
If you want to check for input events without blocking, use XtAppPend‐
ing(). This function returns a value that indicates which types of
events are pending for an application context, or 0 if no events are
pending.
See AlsoXtAppMainLoop(1), XtAppNextEvent(1), XtAppPending(1).
Xt - Event Handling XtAppPeekEvent()