W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

Re: Mouse Lock

From: Glenn Maynard <glenn@zewt.org>
Date: Wed, 22 Jun 2011 05:54:10 -0400
Message-ID: <BANLkTi=8aZLs36CkhWhWTdTBCT0+6SWM1A@mail.gmail.com>
To: Simon Pieters <simonp@opera.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Aryeh Gregor <Simetrical+w3c@gmail.com>, Adam Barth <w3c@adambarth.com>, Vincent Scheib <scheib@google.com>, Brandon Andrews <warcraftthreeft@sbcglobal.net>, "Gregg Tavares (wrk)" <gman@google.com>, Charles Pritchard <chuck@jumis.com>, Kenneth Russell <kbr@google.com>, robert@ocallahan.org, public-webapps@w3.org
On Wed, Jun 22, 2011 at 5:20 AM, Simon Pieters <simonp@opera.com> wrote:

> On Tue, 21 Jun 2011 00:43:52 +0200, Aryeh Gregor <Simetrical+w3c@gmail.com>
> wrote:
>
>> There's a middle ground here: you can lock the mouse to the window,
>> but not completely.  That is, if the user moves the mouse to the edge,
>> it remains inside, but if they move it fast enough it escapes.  This
>> is enough to stop the window from accidentally losing focus when
>> you're trying to click on something near the edge of the screen, but
>> it lets you easily get outside the window if you actually want to.
>> IIRC, Wine does this in windowed mode.  Of course, it might not be
>> suitable for games that want to hide the cursor, like FPSes, but it
>> might be a possible fallback if the browser doesn't trust the site
>> enough for whatever reason to let it fully lock the mouse.
>>
>
> This seems weird. When would you use this middle ground? Would users
> understand it? Also, as you say, totally inappropriate for FPS games.
>

I'd find it annoying to be forced to slow my mouse movements due to mouse
speed having extra, unusual meanings.  I'd suspect accessibility problems
with requiring "move the mouse fast" as a user input, too.

Also, isn't the entire point of mouse lock mouse-delta-based applications,
where there is no mouse pointer?  There's no "moving the mouse to the edge"
when there's no pointer.  I don't think "walling the mouse pointer into a
rectangle" is useful--I can't think of having ever seeing a native Windows
application do that--it'd be very annoying, so I'd remember--and I can't
think of any use cases.


Unrelated, another detail: if most implementations are going to need to warp
the mouse cursor to do this, the other mouse event coordinates should always
be 0 (or null).  Otherwise, implementations on platforms which don't need to
warp the cursor may still fill these in, causing incompatibilities.  Events
like mouseover should probably be suppressed, too.  At that point, it's
probably cleaner to stop firing *all* mouse movement events entirely, as if
the mouse isn't moving, and to use a separate "mousedelta" event when locked
which only has "deltaX" and "deltaY".

-- 
Glenn Maynard
Received on Wednesday, 22 June 2011 09:54:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:45 GMT