Home Building a Better Mouse Lock for Chrome and Firefox

Building a Better Mouse Lock for Chrome and Firefox

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 working on a W3C specification and feature for Chrome that will put browsers another step closer to competitive with native games.

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.

About ReadWrite’s Editorial Process

The ReadWrite Editorial policy involves closely monitoring the tech industry for major developments, new product launches, AI breakthroughs, video game releases and other newsworthy events. Editors assign relevant stories to staff writers or freelance contributors with expertise in each particular topic area. Before publication, articles go through a rigorous round of editing for accuracy, clarity, and to ensure adherence to ReadWrite's style guidelines.

Get the biggest tech headlines of the day delivered to your inbox

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.

    Tech News

    Explore the latest in tech with our Tech News. We cut through the noise for concise, relevant updates, keeping you informed about the rapidly evolving tech landscape with curated content that separates signal from noise.

    In-Depth Tech Stories

    Explore tech impact in In-Depth Stories. Narrative data journalism offers comprehensive analyses, revealing stories behind data. Understand industry trends for a deeper perspective on tech's intricate relationships with society.

    Expert Reviews

    Empower decisions with Expert Reviews, merging industry expertise and insightful analysis. Delve into tech intricacies, get the best deals, and stay ahead with our trustworthy guide to navigating the ever-changing tech market.