1. 面向开发者的 Web 技术
  2. Web API
  3. Document
  4. Document:exitPointerLock() 方法

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

Document:exitPointerLock() 方法

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Document 接口的 exitPointerLock() 方法异步释放先前通过 Element.requestPointerLock 请求的指针锁定。

备注:在文档上调用 exitPointerLock() 方法,在元素上调用 requestPointerLock() 方法。

要跟踪请求的成功或失败,需要监听 pointerlockchange 事件和 pointerlockerror 事件。

语法

js
exitPointerLock()

参数

无。

返回值

无(undefined)。

规范

Specification
Pointer Lock 2.0
# dom-document-exitpointerlock

浏览器兼容性

参见

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /