At 1:10 PM -0700 5/10/99, Eric House wrote:
>The problem is that EvtEventAvail() never returns false, even though
>the only event on the queue is the custom event I'm currently
>processing.  I'm guessing that an event isn't removed from the queue
>until the handler returns true (or until the OS has finished with it
>if it returns false.)

Actually, that's not right.  The event is removed from the queue when it's
returned from EvtGetEvent.

As Roger pointed out, the problem is often that there are subsequent events
still waiting to be processed.  Because controls don't actually use the
penUpEvent (they have their own tracking loop to do the highlighting), they
create and enqueue the ctlSelectEvent, and it gets returned from
EvtGetEvent *before* the penUpEvent is returned.

So if your function is invoked from a control, there will almost always be
a pen up event waiting in the queue.

An easy short-term workaround for this is to dequeue and ignore the pen up
events, or at least the first pen up event.  ...but be warned that you're
starting down that slippery slope to writing a full nested event loop.

                                --Bob


Reply via email to