Avoid PM_MOUSEMOVE message Flood by Guy Sprackland

Postby Admin on Sun Jan 14, 2001 3:19 pm

I use event(0) to "eat" spare PM_MOUSEMOVE events. Normally mousemove
events come in faster than you can process them, so when I get the
first one I call event(0) for events until I get an event that isn't
PM_MOUSEMOVE (perhaps PM_NONE). This is just done to flush the queue. Then
I repost the last event I got:

do {
i_event=event(0) ;
} while (i_event==PM_MOUSEMOVE) ;
postevent(i_event) ;

Without this you have to process many, many mouse events.
penx(), peny() are overwritten with the new pen co-ords on
the later events anyway, so you just and up with many mousemove
events for the most recent position.

Putting the above code in really improved performance on my pen
tracking. It doesn't eat the battery because it stops once it has
emptied the queue of move events.
Posts: 86
Joined: Fri Oct 06, 2000 6:00 am
Location: USA

Return to PocketC for CE KB

Who is online

Users browsing this forum: No registered users and 1 guest