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

Re: Mouse Lock

From: Aryeh Gregor <Simetrical+w3c@gmail.com>
Date: Mon, 20 Jun 2011 18:43:52 -0400
Message-ID: <BANLkTi=DXqDhohG9nPW-77HBVT3u5LLkBw@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Adam Barth <w3c@adambarth.com>, Vincent Scheib <scheib@google.com>, Brandon Andrews <warcraftthreeft@sbcglobal.net>, "Gregg Tavares (wrk)" <gman@google.com>, Glenn Maynard <glenn@zewt.org>, Charles Pritchard <chuck@jumis.com>, Kenneth Russell <kbr@google.com>, robert@ocallahan.org, public-webapps@w3.org
On Mon, Jun 20, 2011 at 1:48 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> A model which I suggested privately, and which I believe others have
> suggested publicly, is this:
> 1. While fullscreen is enabled, you can lock the mouse to the
> fullscreened element without a prompt or persistent message.  A
> temporary message may still be shown.  The lock is automatically
> released if the user exits fullscreen.
> 2. During a user-initiated click, you can lock the mouse to the target
> or an ancestor without a permissions prompt, but with a persistent
> message, either as an overlay or in the browser's chrome.
> 3. Otherwise, any attempt to lock the mouse triggers a permissions
> prompt, and while the lock is active a persistent message is shown.

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.
Received on Monday, 20 June 2011 22:44:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:20 UTC