Document.exitPointerLock()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
exitPointerLock
方法可异步的解锁鼠标(通过Element.requestPointerLock
锁定的)。
追踪是否解锁成功,需要监听pointerlockchange
和pointerlockerror
事件。
语法
document.exitPointerLock();
规范
Specification |
---|
Pointer Lock 2.0 # dom-document-exitpointerlock |
浏览器兼容性
BCD tables only load in the browser