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
BCD tables only load in the browser