Document: pointerlockchange event
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
BCD tables only load in the browser