Document: pointerlockchange event

The pointerlockchange event is fired when the pointer is locked/unlocked.

Bubbles Yes
Cancelable No
Interface Event
Event handler property onpointerlockchange


Using addEventListener():

document.addEventListener('pointerlockchange', (event) => {
  console.log('Pointer lock changed');

Using the onpointerlockchange event handler property:

document.onpointerlockchange = (event) => {
  console.log('Pointer lock changed');


Specification Status
Pointer Lock Candidate Recommendation

Browser compatibility

BCD tables only load in the browser

See also