On Wed, Sep 22, 2010 at 05:41:24PM -0700, Wolf Tivy wrote:
> > In particular, XCheckIfEvent seems well suited to this situation-
> > -feed in a predicate which specifically finds the repeated KeyPress
> > (matches time, key, etc.). But this can perform unnecessary
> > computation since it checks things with higher times as well, of
> > course--I'm still amazed there is no nonblocking analog to
> > XPeekEvent.
>
> Yeah, I looked at the various X*check* functions, they all seem to
> scan the whole queue, which could cause funkyness in this application,
> so they don't seem to be a perfect fit. There _must_ be some way to do
> a nonblocking peek, it would be insane if there wasn't, I just can't
> find it.
Can you explain what could go wrong? The predicate would be passed in
the KeyRelease event (as an XPointer), and return True if it finds
a KeyPress with matching time and keycode.
I dislike scanning the whole queue for efficiency reasons (ostensibly
these are minor, the queue shouldn't become too huge when repeats are
involved?), and agree it is a weird omission. But who knows, maybe the
queue ordering is too unspecified for such an XPeekEvent to actually be
worthwhile (i.e., maybe the X protocol really grants no sequencing, and
therefore, providing such a call would wrongly imply some sequence
guarantees..).
Received on Thu Sep 23 2010 - 03:01:22 CEST
This archive was generated by hypermail 2.2.0 : Thu Sep 23 2010 - 03:12:02 CEST