[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

RE: [pygame] Speed of mouse position capture



 

> -----Original Message-----
> From: owner-pygame-users@xxxxxxxx 
> [mailto:owner-pygame-users@xxxxxxxx] On Behalf Of Brian Fisher
> Sent: Monday, 15 May 2006 4:51 p.m.
> To: pygame-users@xxxxxxxx
> Subject: Re: [pygame] Speed of mouse position capture
> 
> On 5/14/06, Brian Bull 
> <Brian.Bull@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > Dear list,
> >
> Hey Brian
> 
> > I am encountering one difficulty, which is that the speed of mouse 
> > position capture seems quite slow. I had expected that the 
> app would 
> > receive a MOUSEMOTION event every time the mouse shifted to a new 
> > pixel, and that connecting up the locations of these MOUSEMOTION 
> > events would give an almost exact representation of the path of the 
> > mouth across the screen. However, what happens in practice 
> is that, if 
> > the mouse is moving fast, consecutive MOUSEMOTION events 
> can be separated by more than 20 pixels.
> >
> I've run into the exact same problem and done some testing & research.
> Read this blog entry by a microsoft guy:
> http://blogs.msdn.com/oldnewthing/archive/2003/10/01/55108.aspx
> 
> So basically it's not a pygame or SDL problem, it's a windows thing.
> Windows throws out data before sending mouse motion messages 
> (which seems like bad design to me, but oh well)
> 
> Also, my cousin has tested on Linux (debian I think) and I 
> tested on Mac (OS X, not sure with version) for the same 
> problem, and I haven't seen it on either of those (meaning 
> pygame was getting mousemotion messages to describe the movement well)
> 
> 
> > Is there a way to make Pygame sample the position of the 
> mouse more often?
> >
> The only thing I found that could help was to call one of the 
> event handling functions (pygame.event.pump works) because 
> they would call a windows message handling func which would 
> make windows keep another mouse position, but you'd have to 
> have a good way to call it a bunch of times during a frame.

Oh. Could you please post an example of this? Wd be much appreciated.
 
Brian 

(Sorry about the disclaimer, it gets stuck on automatically)
"The information contained in this transmission is confidential. It is intended for the named address only. If you are not the named address you may not copy, distribute or take any action in reliance upon this transmission"