W3cubDocs

/Web APIs

Document: exitPointerLock() method

The exitPointerLock() method 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

js

exitPointerLock()

Parameters

None.

Return value

None (undefined).

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
exitPointerLock 3722 13 5014–50 No 2415 10.1 374.4 3725 5014–50 2414 No 3.01.5

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Document/exitPointerLock