> if (EvtEventAvail())
> {
> EventType event;
> EvtGetEvent(&event, 0);
> if (event.eType == penDownEvent)
> {
> g_UserCancelled = true;
> return true;
> }
> SysHandleEvent(&event);
This way of handling events (nested event loops) is generally a risky
thing. If for example your event loop is trying to grab some events and
special-case them, it won't work in this case. And you're not calling
MenuHandleEvent or FormDispatchEvent like your real event loop would... so
some events might not get handled properly.
You could check if the pen is down, and (depending on how frequently you
check) it might have the same result, without actually dequeueing any
events.
-David Fedor
Palm Developer Support