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

Re: [pygame] mouse outside window



re zak's get_focus suggestion: unfortunately pygame.mouse.get_focus always returns true, whether the mouse is in or out, and whether the app is front or not, so that doesn't seem like it'll help.

is there any way inside pygame (i.e. not hacking the source or SDL) to determine whether the mouse is in the bounds of the window? i could still use zak's suggestion of not sending events in this case.

thanks,
jeremy


On Friday, September 26, 2003, at 04:11 PM, Bob Ippolito wrote:


On Friday, Sep 26, 2003, at 16:02 America/New_York, Jeremy Biddle wrote:

on OSX/py2.3/pygame, mouse motion outside the window returns coordinates that are clamped to the window -- is this expected behavior?

i am mousing around and when i go outside the window my objects that are sitting on the borders still receive mouse events, which i would rather they not, since the mouse isn't actually over them!
I'm 99% sure that this is expected SDL behavior for OS X. If you don't like it, bring it up with them :)

And while you're at it, tell them to make it so that mouse cursors unhide when you leave the bounds of the window.. I wrote a patch for this, I'll have to dig it up, but it was really trivial.

-bob