Re: Mouse Lock

On Mon, Jun 20, 2011 at 1:48 PM, Tab Atkins Jr. <> 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