Capturing mouse position outside of browser window?

前端 未结 4 1398
-上瘾入骨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:28

    To answer your question, no, you can't get mouse events from outside the window (including its position).

    There is the Mouse Lock API, which is designed specifically for the case you describe. It locks the cursor to the current window. Support is virtually non-existent right now, but one day..!

提交回复
热议问题