working on a W3C specification and feature for Chrome that will put browsers another step closer to competitive with native games.Build a better mouse trap, and the world will beat a path to your door. Build a better mouse lock for Web browsers, and you might make browser-based gaming a lot more attractive. Vincent Scheib has been
This might sound like a little thing, but the lack of the mouse lock feature holds back browser-based games. Here's the problem: Unless you're using a plugin, the way that browser-based games handle the mouse is clunky. Let's say you're trying to play a shooter like Quake III in the browser. Because the game can't "grab" the pointer, when you scroll too far outside the game screen it sends your cursor outside the browser window and disrupts game flow. (And probably gets you fragged.)
But it's not just for games. This would also be useful for apps like Google Maps, so that the map doesn't stop scrolling when users hit the corner of the screen. That's the physical screen. If you try Google Maps you can hold down the mouse button and keep scrolling even when the cursor leaves the window, but it stops when you hit the edge of the screen.
Note that mouse lock is different than mouse capture, because mouse capture ends when the mouse button is released. The mouse lock holds the pointer until a special key binding or gesture is used, and sends input "regardless of mouse button state." It also hides the cursor, whereas mouse capture does not.
So Scheib and others are working on providing a mouse lock that will enable all sorts of applications to be on par with their native client counterparts. David Humphrey is all over an implementation for Firefox, and Scheib says that developers can test it out in the Chrome Canary builds right now.
It will be a few more releases (Scheib says no sooner than Chrome 19) before it's shipped without a developer flag. Actually, it's available in Chrome 16 or later for Native Client apps, but not for other applications. Right now, the feature only works in full screen, and Scheib says that it will also need a security review before it's ready to go. (Grabbing the mouse would give spammers a pretty annoying tool to work with if left unchecked.) Since Firefox folks are also on this, it might not be too much longer before we can seen cross-browser apps that make the most of mouse lock.