[Scummvm-devel] making mouse position changes only when mouse is within ScummVM window?

Paul Gilbert paulfgilbert at gmail.com
Fri Jun 11 00:43:48 CEST 2010


On Fri, Jun 11, 2010 at 12:13 AM, M. Kiewitz <
m_kiewitz at users.sourceforge.net> wrote:

>
> Theoretically we could just implement this change for SCI only, although I
> think that no engine should change mouse cursor position at any time.
> Limiting it to the Ctrl-M mode isn't good as well, because we would disable
> it completely for the regular windowed mode and this would break some games
> and I also bet that most users don't use that mode anyway. Personally I'm
> not using it either, because that's even worse when I want to do multiple
> things simultaneously.
>
> Any thoughts about this?
>
> Regards
>  M. Kiewitz
>

Although I'm not particularly familiar with the SDL backend, I don't see it
as being much of an issue either. There isn't any API function to get the
current mouse position - it only gets provided with mouse events (AFAIK). So
if a call to warpMouse is made by the game engine, and the cursor is outside
the window, then no mouse events would be generated anyway (and the game
will presume the cursor is still at the position it was warped to) until the
mouse returns to the window . At which point any further calls to warpMouse
could move the cursor.

Quite a few of the engines use warpMouse, so it's probably best to have a
consistent handling across all of them. There is still the problem with
leaving the window if the warpMouse gets called rapidly, though. I saw that
got raised on the IRC channel, so for games that use warpMouse to enforce a
bounding box, the user will still be prevented from moving the mouse
off-screen.

Regards,

Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20100611/ff0ce459/attachment.html>


More information about the Scummvm-devel mailing list