[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] pygsear, pygame framework & examples



I had a rough time with my mouse (optical logitech), in pygsaw.py.Anyone have any ideas why?
That is the only place I know of that I am using

pygame.mouse.get_pos()
pygame.event.pump()

It is certainly possible that I am using it incorrectly
and/or that get_pos() does not agree with your mouse.
explain "rough time" a little better? is it jumping around? sticking?
lee, it sounds like you have the event and mouse all setup fine. actualy.. if you aren't grabbing any regular pygame events, try pygame.event.clear()? perhaps the SDL event queue is getting filled up (not too hard with MOUSEMOTION events).

It uses both. Each time through the mainloop it will do a

pygame.event.get()

to check for button presses and keyboard events ([ESC])

Then it will do

pygame.mouse.get_pos()
pygame.event.pump()

to get the mouse position ONLY if you are dragging a piece.

I suppose it could ignore MOUSEMOTION events as they are not
being used. Might speed it up a bit...

You can pull the latest version from cvs if you want to try it:

http://savannah.nongnu.org/cgi-bin/viewcvs/pygsear/pygsear/examples/pygsaw.py

Let me know if that makes any difference.


_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org