Document: pointerlockchange event

翻译不完整。 请帮助我们翻译这篇文章!

pointerlockchange 事件当指针解锁或者被锁定时触发

冒泡 Yes
可取消 No
接口 Event
Event handler property onpointerlockchange

例子

使用 addEventListener():

document.addEventListener('pointerlockchange', (event) => {
  console.log('Pointer lock changed');
});

使用 onpointerlockchange 事件处理程序属性

document.onpointerlockchange = (event) => {
  console.log('Pointer lock changed');
};

Specifications

Specification Status
Pointer Lock Candidate Recommendation

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
pointerlockchange event
Experimental
Chrome Full support 45
Full support 45
No support 22 — 45
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support ≤79Firefox ? IE ? Opera ? Safari ? WebView Android Full support 45
Full support 45
No support ? — 45
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android Full support 45
Full support 45
No support 25 — 45
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android Full support 5.0
Full support 5.0
No support 1.5 — 5.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit

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.

参考