XtAppPeekEvent() XtAppPeekEvent()
Name
XtAppPeekEvent - 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 pending 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
removing it from the queue) and returns True or returns False otherwise. Note that XtAppPeekEvent() never calls background work procedures
registered with XtAppAddWorkProc() .
Usage
Programs rarely need this much control over the event dispatching mechanism. Most programs use XtAppMainLoop().
If you want to get X events and remove them from the input queue, consider XtAppNextEvent(). This function also dispatches timer and
alternate input events.
If you want to check for input events without blocking, use XtAppPending(). 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()
Check Out this Related Man Page
XtAppNextEvent() XtAppNextEvent()
Name
XtAppNextEvent - dispatch timer and alternate input event and return the next X event.
Synopsis
void XtAppNextEvent(app_context, event_return)
XtAppContext app_context;
XEvent *event_return;
Inputs
app_context Specifies the application context.
Outputs
event_return
Returns the dequeued event structure.
Description
If there is an X event pending on any of the Displays in app_context, XtAppNextEvent() returns that event in event_return. Otherwise, it
flushes the X output buffer of each Display, and if there is a background work procedure registered (see XtAppAddWorkProc()), XtAppNex-
tEvent() calls it and starts over by checking for pending events. If there are no pending events and no work procedures, XtAppNextEvent()
blocks while waiting for input on any of the Display connections, activity on any of the alternate input sources registered with XtAp-
pAddInput(), or the expiration of any timers registered with XtAppAddTimeOut().
If there is activity on an alternate input source or if a timeout interval elapses, XtAppNextEvent() calls the callback that was registered
with the input source or with the timer. If an X event occurs, XtAppNextEvent() removes that event from the queue and returns it in
event_return.
Usage
Programs rarely need this much control over the event dispatching mechanism. Most programs use XtAppMainLoop(). If you want to process a
single X, input, or timer event, consider XtAppProcessEvent().
See AlsoXtAppAddInput(1), XtAppAddTimeOut(1), XtAppAddWorkProc(1), XtAppMainLoop(1), XtAppPeekEvent(1), XtAppPending(1), XtAppProcessEvent(1),
XtDispatchEvent(1).
Xt - Event Handling XtAppNextEvent()
hi,
I have a file that contains one line with , at the end of it and I want to remove it using sed
I tried
s/,$//g
but it does not work
thanks (4 Replies)
Hello, everyone.
Could someone, please, tell me how to get the number of bytes in the terminal input queue without blocking and without consuming these bytes? I guess it could be called the peek functionality.
I've looked at termio tcgetattr() and tcsetattr() functions but could not find... (4 Replies)
Hello to all in forum,
I need to count how many events happens within each second for 01 Aug 2013.(because in the sample appears records for 01 Aug and 02 Aug).
The output for the input below should be:
Desired Output:
--> 2 Records
--> 1 Record
--> 3 Records
Input:
DEBUG... (5 Replies)