> How do I flush (clear) all the events related to my app. programmatically?
This has been asked in the past (it may even have been you.) RTFM, my friend.
I did a search on the API Reference index page for "Flush", and the first
thing I found was what I was looking for. Examine the manual pages for
EvtFlushKeyQueue
EvtFlushPenQueue
EvtEventAvail
EvtSysEventAvail
And you should also be able to do it by using EvtGetEvent until you start
recieving Nil events.
Something similar to the following may work:
EventType event;
while ( EvtEventAvail() ) EvtGetEvent (&event, 0);
If you wanted to go farther than that (the above code would completely ignore
the events remaining in the queue, which isn't playing nice) you could:
EventType event;
while ( EvtSysEventAvail(false) ) {
EvtGetEvent(&event, 0);
if ( !SysHandleEvent(&event) )
if ( !MenuHandleEvent(0, &event, &error) )
if ( !ApplicationHandleEvent(&event) )
FrmDispatchEvent(&event);
}
The above code would allow the system (and your application) to handle the
events nicely, and quickly. It's basically a complete copy of a standard
event loop, that only loops until there are no more events left. (Using
EvtSysEventAvail gives finer-grained looping, as this deals with low-level
system events as well as higher level events... things like pen up, etc.)
--
Matthew (Darkstorm) Bevan [EMAIL PROTECTED]
Margin Software, NECTI. http://www.marginsoftware.com
Re-inventing the wheel, every time.
- "I was gratified to be able to answer promptly, and I did. I said I
didn't know."
-- Mark Twain
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/