Re: Mouse Lock

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.

~TJ

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