Window: gamepaddisconnected イベント
gamepaddisconnected
イベントは、ゲームパッドが切断されたことをブラウザーが検出したときに発行されます。
このイベントは、文書の gamepad
権限ポリシーが不許可になっている場合には発生しません。
このイベントはキャンセル不可で、バブリングしません。
例
ゲームパッドが切断されたことを通知するには、addEventListener()
を使用してウィンドウにハンドラーを追加します。
js
window.addEventListener("gamepaddisconnected", (event) => {
console.log("ゲームパッドの接続が失われました。");
});
また、window.ongamepaddisconnected
イベントハンドラプロパティを使用して、gamepaddisconnected
イベントのハンドラーを確立することもできます。
js
window.ongamepaddisconnected = (event) => {
console.log("ゲームパッドの接続が失われました。");
};
仕様書
Specification |
---|
Gamepad # event-gamepaddisconnected |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
gamepaddisconnected event |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.