Document: pointerlockerror event

The pointerlockerror event is fired when locking the pointer failed (for technical reasons or because the permission was denied).

Bubbles Yes
Cancelable No
Interface Event
Event handler property onpointerlockerror

Examples

Using addEventListener():

const para = document.querySelector('p');

document.addEventListener('pointerlockerror', (event) => {
  console.log('Error locking pointer');
});

Using the onpointerlockerror event handler property:

document.onpointerlockerror = (event) => {
  console.log('Error locking pointer');
};

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
pointerlockerror_event
45
22-45
≤79
50
14-50
?
?
10.1
45
≤37-45
45
25-45
50
14-50
?
No
5.0
1.5-5.0

See also

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