MDN self-hosted library · e01.org

Document: exitPointerLock() method

Pointer Lock API

no runnable cells web-api-instance-method upstream source

Pointer Lock API

The exitPointerLock() method of the Document interface asynchronously releases a pointer lock previously requested through Element.requestPointerLock.

[!NOTE] While the exitPointerLock() method is called on the document, the requestPointerLock() method is called on an element.

To track the success or failure of the request, it is necessary to listen for the pointerlockchange and pointerlockerror events.

Syntax

exitPointerLock()

Parameters

None.

Return value

None (undefined).

Specifications

Browser compatibility

See also

  • Document.pointerLockElement
  • Element.requestPointerLock()
  • Pointer Lock