3 ms·
If only there were an API for mouse capturing. Is there any reason why it couldn't work if it were implemented like full screen mode (displaying a message tell
by stevenleeg 14y ago
If only there were an API for mouse capturing.
Is there any reason why it couldn't work if it were implemented like full screen mode (displaying a message telling the user to press escape to reclaim the mouse)?
Edit: Actually it looks like this is being worked on after all – http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html http://dvcs.w3.org/hg/pointerlock/raw-file/default/index.htm...
- gringomorcego 14y agoSeriously, what the hell is the point of even creating something like webgl if a key feature for immersion is kept out? It's like building a car starting with the frame. God speed to whoever is fighting the good fight on those frigging w3c boards.
- azakai 14y agoAs mentioned above, this feature does in fact exist.
- gringomorcego 14y agoAh, wrote before the edit.
- tec27 14y agoYeah, it does exist and is usable in current versions of Chrome if you change the flag for it. I'm not sure if the Chrome version of the API is what the final one will be though, since it seems to differ somewhat from the version documented on MDN: https://developer.mozilla.org/en/API/Pointer_Lock_API https://developer.mozilla.org/en/API/Pointer_Lock_API Still it would probably be fairly easy to add support for it to this and replace the annoying click-drag camera movement when possible.
- azakai 14y agoThis exists in Firefox as of 14, currently in Aurora, so this will be in a stable release in a few weeks. It also exists in recent Chrome versions, however it seems to be disabled by default for some reason, but you can enable it in the flags menu. No reason why this cool site can't use it on those browsers, there are lots of demos on the web that do. Mouse lock is very important.
- AgentConundrum 14y ago> This exists in Firefox as of 14, currently in Aurora, so this will be in a stable release in a few weeks. Firefox 14 is scheduled for release on Tuesday.[1] [1] https://wiki.mozilla.org/RapidRelease/Calendar#Future_branch_dates https://wiki.mozilla.org/RapidRelease/Calendar#Future_branch...
- azakai 14y agoEven better ;) Thanks for the correction!
- AgentConundrum 14y agoNo problem. I looked it up last week because I thought this was the release that was going to have the new fix for add-on-related memory leaks[1], but it turns out that's not coming until Firefox 15 next month. [1] http://news.softpedia.com/news/Firefox-15-to-Fix-All-Common-Add-on-Memory-Leaks-269898.shtml http://news.softpedia.com/news/Firefox-15-to-Fix-All-Common-...
- lloeki 14y ago> It also exists in recent Chrome versions, however it seems to be disabled by default for some reason It's enabled at least for the Chrome Store/NaCl apps, since it did that to me for Bastion and/or From Dust.
- obtu 14y agoThe reason would be security-related, as usual. I take it you deal with the clickjacking potential, and the potential for deliberate annoyances?
- azakai 14y agoFullscreen also has security issues, more in fact, I believe? And it is not behind a flag. Also, mouse lock is enabled in Chrome in NaCl apps, but not HTML5 ones. So I am not clear on what's going on there.
- ricardobeat 14y agoI just implemented that in a fork: https://github.com/danielribeiro/WebGLCraft/ https://github.com/danielribeiro/WebGLCraft/ Only works in Chrome for now, if you enable it in chrome://flags. You don't even need to be in full-screen mode, at least on the latest version. Pull request is here: https://github.com/danielribeiro/WebGLCraft/pull/1 https://github.com/danielribeiro/WebGLCraft/pull/1
- ricardobeat 14y agoOops. That first link should be https://github.com/ricardobeat/WebGLCraft/ https://github.com/ricardobeat/WebGLCraft/ Page at http://ricardobeat.github.com/WebGLCraft/ http://ricardobeat.github.com/WebGLCraft/, press C to enable mouse lock. Aiming doesn't work very well...