Re: Mouse Capture for Canvas

On Wed, Feb 9, 2011 at 10:52 PM, Robert O'Callahan <robert@ocallahan.org>wrote:

> What are some real use-cases for capturing with the mouse up in
> non-fullscreen windows? Do a significant number of users want to play
> mouse-capturing games in non-fullscreen mode?
>

I'd certainly want to be able to debug them in a window.

It applies to non-game uses, too.  For example, a common annoyance with
Google Maps is when you're dragging the map and your mouse cursor hits the
side of the screen, the map stops moving; you have to release the button and
reposition the cursor.  Mouse grabbing would trivially fix this.

Being fullscreen and grabbing the mouse are orthogonal features, though of
course browsers could use fullscreen as a factor in deciding whether to
honor a request to grab the mouse cursor.  They might be more lenient with
granting the request in fullscreen.

I agree an API to get mouse deltas is needed. I would suggest introducing a
> completely separate API that lets applications monitor mouse deltas while
> their window has focus, one that doesn't interact with normal mouse events
> at all.
>

At least in Windows, it's hard to get deltas without grabbing the mouse.  If
the mouse cursor is at the right edge of the screen and the user moves the
mouse to the right, Windows doesn't report the motion--the clamping happens
too early on.  Games work around this by hiding the mouse cursor and
constantly warping the hidden cursor to the center of the screen, which is
probably what browsers would do too.

-- 
Glenn Maynard

Received on Thursday, 10 February 2011 04:32:48 UTC