0

How is it possible, to use pointerlock without fullscreen mode?

The tutorials on the web uses the fullscreen api too: https://developer.mozilla.org/en-US/docs/WebAPI/Pointer_Lock

don kaka
  • 1,179
  • 2
  • 12
  • 28

1 Answers1

1

http://jsfiddle.net/DerekL/wbhsP/

Just call requestPointerLock on a user action. It doesn't require the element to be fullscreen.

Derek 朕會功夫
  • 92,235
  • 44
  • 185
  • 247
  • It also worth to mention that it should also work with mozRequestPointerLock - afaik, it wasn't the case few versions ago, which required being in fullscreen mode. – Maël Nison Sep 21 '13 at 22:22
  • **ps** jsfiddle's iframe sandbox don't allow pointerLock: here is the same demo: https://fiddle.jshell.net/wbhsP/13/show/light/ – Endless May 09 '16 at 13:19