Peeking into the event queue?

Hi all,
I'm wondering if there is any way (easy preferred, hard acceptable) to
peek into the event queue (to see if a particular event is
pending)?  Specifically, I'm looking for an equivalent to XCheckIfEvent(),
but there doesn't seem to be one.

The reason I'm looking for it is that I'm inside a loop, doing a bunch of
work, and I need to periodically check to see if the user has hit a key to
cancel the operation.
The relevant code is a callback that is initiated by an idle event.  Thus,
it is blocked, with no events being processed, eliminating any possibility
of setting up signal handlers, etc.

While digging through the code, I found the 'queued_events' inside
gdkevents.c, and I was thinking I could just look through that.  However,
there doesn't seem to be any way to access it, nor am I sure that the X
events will have been put into it by that point (Anyone know?)

So in summary, how can I tell if a specific event is pending, without
having to wait for that event to be dispatched to a signal handler?
Thanks for any info!

P.S. Is there any way to search the mailing list archive?  There doesn't
seem to be...

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]