Document: pointerlockchange event
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
pointerlockchange
事件当指针解锁或者被锁定时触发
冒泡 | Yes |
---|---|
可取消 | No |
接口 | Event |
Event handler property | onpointerlockchange |
例子
使用 addEventListener()
:
js
document.addEventListener("pointerlockchange", (event) => {
console.log("Pointer lock changed");
});
使用 onpointerlockchange
事件处理程序属性
js
document.onpointerlockchange = (event) => {
console.log("Pointer lock changed");
};
Specifications
Specification |
---|
Pointer Lock 2.0 # pointerlockchange-and-pointerlockerror-events |
Pointer Lock 2.0 # dom-document-onpointerlockchange |
浏览器兼容性
BCD tables only load in the browser