Capturing mouse position outside of browser window?

前端 未结 4 1352
-上瘾入骨i
-上瘾入骨i 2021-01-22 14:57

One major barrier to creating immersive experiences in the browser (using WebGL and similar) is the set of limitations placed on mouse control.

For instance a first per

4条回答
  •  一整个雨季
    2021-01-22 15:31

    That really seems like a far bigger security issue than allowing the developer to reposition the cursor. The answer is no, there's no such thing. And there probably won't ever be one. Sorry!

    Update: I was, of course, talking about the capturing outside the window that would be a problem. It's very likely that there will ever be an API that locks the mouse, maybe after asking the user's permission. As nickf pointed out, they're already working on it -https://www.w3.org/TR/pointerlock/

    Original defunct link - http://dvcs.w3.org/hg/webevents/raw-file/default/mouse-lock.html

提交回复
热议问题