How to set mouse position?

I want to detect the acceleration vector of a trackball.
I need to compare the current mouse position to the
previous position. To overcome the screen boundaries
problem, each time I read the mouse position I would set
it back to the center of the screen. Of course the
cursor would be invisible…

So how can I set the mouse position?

Marc

I want to detect the acceleration vector of a trackball.
I need to compare the current mouse position to the
previous position. To overcome the screen boundaries
problem, each time I read the mouse position I would set
it back to the center of the screen. Of course the
cursor would be invisible…

If you hide the mouse cursor and grab the input, then SDL will go
into “relative motion” mode, and automatically center the cursor when
it reaches the edge, or use raw mouse mickeys when available.

This is only implemented on Win32 and Linux.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

SDL_WarpMouse will do what you need.

At 12:33 PM 14/10/2000 -0400, you wrote:>I want to detect the acceleration vector of a trackball.

I need to compare the current mouse position to the
previous position. To overcome the screen boundaries
problem, each time I read the mouse position I would set
it back to the center of the screen. Of course the
cursor would be invisible…

So how can I set the mouse position?

Marc