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

Re: [pygame] mouse outside window



Bob Ippolito wrote:
I'm 99% sure that this is expected SDL behavior for OS X. If you don't like it, bring it up with them :)

What are the exact semantics of mouse events for Win32? I'll write a patch to the quartz backend to fix this right up, submit it to SDL, and post my version of the libraries to my Package Manager repository so nobody has to wait for them.
i just wrote a handy little tool that should make it easier to see what is going on with pygame/sdl devices and events..

http://www.pygame.org/ftp/contrib/focusreport.py

it will actually show you quite a few things, handy is all input events. fun to play with and see what info your window is getting. it even enables the joystick for some hat and wheel fun!

anyways, after some quick testing, it appears windows and linux have the exact same behavior. i suppose if osx matched this as well we'd have a nice expected set of rules.

when the mouse moves out of the window, the 'Mouse Position' stops update. we also see an ACTIVEEVENT with state=1 gain=0. obviously when the mouse returns the 'Mouse Position' starts updating again, and we see another ACTIVEEVENT with state=1 gain=1.

in the little app, when you hold a mouse button down it will grab the window input focus. on both linux and windows when this happens the mouse cannot leave the window client area, it is trapped onto the window.

because of these rules, pygame/sdl can never really "see" the mouse outside the screen area. sdl will never report a position outside the screen area.