3 ms·
Unfortunately there's no easy way to do that with the current state of JavaScript and WebGL. If you try to just translate raw mouse events into it you end up wi
by Pewpewarrows 15y ago
Unfortunately there's no easy way to do that with the current state of JavaScript and WebGL. If you try to just translate raw mouse events into it you end up with lots of bugs related to the cursor reaching edges of the rendered area, browser window, or desktop in general.
The ideal solution in my opinion is to just offer mouse capturing as a user-enabled permission on page load from a domain (kind of how geolocation works now). The user would see a bar near the top of the browser asking if they want to give control of their mouse to the website, with the option to always break-out of that control with some key (such as ESC).
- elisee 15y agoChrome devs are working on such an API. - Bug tracker: http://code.google.com/p/chromium/issues/detail?id=72754 http://code.google.com/p/chromium/issues/detail?id=72754 - Design doc: https://sites.google.com/a/chromium.org/dev/developers/design-documents/mouse-lock https://sites.google.com/a/chromium.org/dev/developers/desig...