The basic design of the PalmOS event loop is such that you can't tell it how
long to wait, only how long you're willing to wait. In other words, it is
always allowed to return early, and when it does, it returns a nilEvent. So,
it's your job to keep track of time, so you know whether it's time for you
to do something or not. Ideally, you should check whether it's time after
getting every event, not just nilEvents. Since you only want to time while
the device is on, you can use TimGetTicks as your clock for scheduling
animations. Since this clock is reset to zero when the device is reset, and
since it only runs when the device is on, you can probably get away without
handling the wrap-around (when it gets too big to fit, wrapping back around
to zero). Best would be to play it safe and handle wrap-around anyway.
--
Peter Epstein
> ----------
> From: George Aslanis
> Reply To: Palm Developer Forum
> Sent: Monday, May 7, 2001 3:47 PM
> To: Palm Developer Forum
> Subject: nilEvents are falling all over the floor!!!
>
> Hello,
>
> I use nilEvents & elapsed time to create a poor man's timer function. All
> is well until.....a pendown in a field. I display the wait parm in my
> main
> loop for EvtGetEvent. It always displays the value I set whether it is
> 5000
> or 2500 ms., but when the a field is selected the nilEvents start firing
> as
> fast as the main loop will run.
>
> I've set handled = true and handled = false, with no change. Why is this
> happening and more importantly how can I get it to maintain the waittime I
> set?
>
> Thanks for listening!
> --
> George Aslanis
> [EMAIL PROTECTED]
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/