Search code examples
javascripthtmlpointerlock

Pointerlock without fullscreen API


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


Solution

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

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