Document: pointerlockchange event

Questo contenuto viene visualizzato in inglese perché non è ancora disponibile una versione tradotta nella lingua selezionata. Aiutaci a tradurre questo articolo!

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

Bubbles Yes
Cancelable No
Interface Event
Event handler property onpointerlockchange

Examples

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');
};

Specifications

Specification Status
Pointer Lock Candidate Recommendation

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
pointerlockchange event
Experimental
Chrome Full support 45
Full support 45
No support 22 — 45
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ? Firefox ? IE ? Opera ? Safari ? WebView Android Full support 45
Full support 45
No support ? — 45
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android Full support 45
Full support 45
No support 25 — 45
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also