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
Specification | Status |
---|---|
Pointer Lock | Candidate Recommendation |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
pointerlockerror event | Chrome
Full support
45
| Edge Full support ≤79 | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android
Full support
45
| Chrome Android
Full support
45
| Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android
Full support
5.0
|
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.