Reference exitPointerLock()

exitPointerLock()

Exits a pointer lock started with requestPointerLock.

Calling requestPointerLock() locks the values of mouseX, mouseY, pmouseX, and pmouseY. Calling exitPointerLock() resumes updating the mouse system variables.

Note: Most browsers require an input, such as a click, before calling requestPointerLock(). It’s recommended to call requestPointerLock() in an event function such as doubleClicked().

Examples

Notice any errors or typos? Please let us know. Please feel free to edit src/events/mouse.js and open a pull request!

Related References