Gert van Kruiningen wrote:
> With the timeout set to -1, this simulator just goes to sleep because there
> is nothing to process, and if you move the stylus over the screen, it starts
> to move again.
> But on the real T3, it keeps on racing along. So the trick is to find out
> what the events are that it comes back with. There is no such thing as
> "View" "Events" on the real T3, but displaying data on the screen, events
> coming out of EvtGetEvent() does not seem to work yet!!!
> Oh its going now and guess what, it's the nilEvent that is returned all the
> time by EvtGetEvent(), until you move the stylus on the screen of course and
> press buttons.
> Where is this nilEvent coming from? Anybody got an idea?
Don't know.
More importantly, I don't think the documentation guarantees that you
won't get nilEvents at random times. I would just write the app to be
able to handle getting a nilEvent at any time. If you would like to
do something once a second, do something like this:
Boolean HandleNilEvent (const EventType *eventptr)
{
static UInt32 tickinterval = SysTicksPerSecond();
static UInt32 nexttime = 0;
switch (eventptr->eType)
{
case nilEvent:
if (TimGetTicks() >= nexttime)
{
DoPeriodicThing();
nexttime = TimGetTicks() + tickinterval;
}
break;
}
return (false);
}
- Logan
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/