[SDL] Using mouse movement in SDL 1.2 even if cursor moves beyond window or screen

Justin Coleman jmcoleman at gmail.com
Thu Dec 30 15:00:57 PST 2010


You'll need to set the mouse position to the center of the screen
every time you go through your main loop, that way you'll continue to
receive motion events (as it will never hit the edge of the screen).

On Thu, Dec 30, 2010 at 4:34 PM, David Bruce <davidstuartbruce at gmail.com> wrote:
> Hi,
>
> As part of tuxmath, we now have an Asteroids-like game, and have added
> mouse control of the ship.  Specifically, the ship's rotation is
> controlled by lateral motion of the mouse.  However, this only works
> until the cursor hits the edge of the window or screen.  The cursor
> position itself isn't used by the program.  Does SDL provide a way to
> receive all mouse-motion events, irrespective of the cursor position?
> I can see that what I'm requesting might not make much sense if our
> program is running in a window, but I would hope it would be supported
> for fullscreen apps.
>
> Thanks for any help,
>
> David Bruce
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



More information about the SDL mailing list