A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/ja/docs/Web/API/Document/pointerlockchange_event below:

Document: pointerlockchange イベント - Web API

Document: pointerlockchange イベント

Limited availability

pointerlockchange イベントは、ポインターがロックされたり解除されたりしたときに発行されます。

イベントハンドラーは Document.pointerLockElement を使用して、ポインターがロックされているかどうか、ロックされている場合はどの要素にロックされているかを判断することができます。

このイベントはキャンセル不可で、バブリングしません。

構文

このイベント名を addEventListener() などのメソッドで使用するか、イベントハンドラーのプロパティを設定するかしてください。

addEventListener("pointerlockchange", (event) => {});

onpointerlockchange = (event) => {};
イベント型

一般的な Event です。

例

addEventListener() を使用した場合

addEventListener("pointerlockchange", (event) => {
  if (document.pointerLockElement)
    console.log("The pointer is locked to: ", document.pointerLockElement);
  else {
    console.log("The pointer is not locked");
  }
});

onpointerlockchange イベントハンドラープロパティを使用した場合

document.onpointerlockchange = (event) => {
  if (document.pointerLockElement)
    console.log("The pointer is locked to: ", document.pointerLockElement);
  else {
    console.log("The pointer is not locked");
  }
};
仕様書 ブラウザーの互換性 関連情報

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4