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

Re: Mouse Lock

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 20 Jun 2011 14:21:57 -0700
Message-ID: <BANLkTi=7qYd8X4LmwHQ2TPss453TT2P0o3F2HqzPdQP9CyARnQ@mail.gmail.com>
To: Glenn Maynard <glenn@zewt.org>
Cc: 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 Mon, Jun 20, 2011 at 1:06 PM, Glenn Maynard <glenn@zewt.org> wrote:
> On Thu, Jun 16, 2011 at 6:21 PM, Vincent Scheib <scheib@google.com> wrote:
>> - Mousemove event gains .deltaX .deltaY members, always valid, not just
>> during mouse lock.
> Is this implementable?
> First-person games typically implement delta mouse movement by hiding
> the mouse cursor, warping the invisible cursor to the center of the
> screen when it moves, and monitoring the distance of mouse movement
> from the center of the screen to calculate deltas.  I don't think
> Windows provides a way to retrieve delta mouse movements that doesn't
> clip when the mouse reaches the edge of the screen.  I'm not sure
> about other environments.

In a non-mouselock situation, mouse events stop being fired anyway
when the mouse goes outside of the window, so you don't have to worry
about the delta information.

In a mouselock situation, the browser can do precisely what you
describe to keep the mouse from leaving the window.

Received on Monday, 20 June 2011 21:22:44 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:32 UTC