[SDL] Re: SDL_WarpMouse() and SDL_ShowCursor()

Christian Walther cwalther at gmx.ch
Mon Nov 28 01:51:27 PST 2005


David Olofson wrote:
> No showstopper - just wondering why it is not documented that 
> SDL_WarpMouse() has no effect while the mouse cursor is hidden on 
> some(?) platforms. The logic makes some sense, sort of (why move the 
> cursor when you can't see it anyway?), but it helps if things are 
> documented and concistent across platforms. :-)
> 
> While this supposedly doesn't happen on Win32 (I haven't verified this 
> myself), I've found some info indicating that this happens on 
> Solaris, and now I can conclude that it happens on Linux/AMD64 with 
> Xorg as well. (Guess it's an X thing, but can't be arsed to check 
> right now.)

Here on Mac OS X (Cocoa), SDL_WarpMouse() does affect hidden mouse 
cursors (grabbed or not), and that makes perfect sense to me. After all, 
even though invisible, the cursor still has a position that is affected 
by mouse movements, is reported in mouse events, and can be read using 
SDL_GetMouseState() - so one should also be able to set it using 
SDL_WarpMouse(). If that's not the case on X, I'd consider that a bug 
(unless the other three properties aren't satisfied there either).

  -Christian





More information about the SDL mailing list