On Wed, 7 Apr 1999, Gordon wrote:
> Dear Sir,
>
> I know EvtGetEvent would be called in EventLoop again and again.
> But I find that it will be called when there is a pen interrupt. So how
> do I set EvtGetEvent so that it would be called many times without any
> interrupt?
the palm pilot application environment is entirely event driven.
the main loop in every palm application is the EventLoop.
the EvtGetEvent() gets the next event from the event queue - which
can occur in one of two ways:
1) triggered
2) timeout
triggered:
----------
when something happens in the system - such as a pen down, button
press etc, or a manual posting of an event within your code
somewhere.
timeout:
--------
you can say "please wait this long, if not - run this bit of code"
the second parameter to the EvtGetEvent() function is the timeout.
-1 means waitforever. if you have a value greater than equal to
zero, it means wait n/10 of a second. (ie: 100 = 1 second).
after a timeout, there is supposed to be a nilEvent stored in the
first parameter.. i have not tested this - because i know if it the
event is NOT one of the events i am expecting - it has to be the
nilEvent.
if you want a event every 10 milliseconds (like for animations), you
would write this:
EvtGetEvent(&event, 1);
if (...) {
// any known events?
}
else {
// do animation
}
i hope this clears things up.
az.
--
Aaron Ardiri
Lecturer http://www.hig.se/~ardiri/
University-College i G�vle mailto:[EMAIL PROTECTED]
SE 801 76 G�vle SWEDEN
Tel: +46 26 64 87 38 Fax: +46 26 64 87 88
Mob: +46 70 352 8192 A/H: +46 26 10 16 11