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

Re: [pygame] pygame standard mouse



Wahid Marditama wrote:
Hi all,

I find the standard mouse in pygame is slow when display is set to fullscreen. Anyway around this? Or, is there a good 'virtual' mouse code? I tried writing one but it does not work as expected.

Wahid

Yeah, I had that happen too. The way I fixed it was in my main loop, I throw away all mouse movements except one. This forces you to update the mouse once per loop, instead of many times per loop. DirectX appears to be feeding every XY transformation to the event loop, instead of 'most recent coordinates' as happens in windowed mode.


For simplicity, I throw all away except the first one. If you wanted to be more accurate, you should probably throw away all except the LAST movement. That way you're always guaranteed of being up to date.

--Kamilche