Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Window
  4. gamepaddisconnected

Window: gamepaddisconnected event

Baseline 2025
Newly available

Since December 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Thegamepaddisconnected event is fired when the browser detects that a gamepad has been disconnected.

The event will not fire if disallowed by the document'sgamepadPermissions Policy.

This event is not cancelable and does not bubble.

Syntax

Use the event name in methods likeaddEventListener(), or set an event handler property.

js
addEventListener("gamepaddisconnected", (event) => { })ongamepaddisconnected = (event) => { }

Examples

To be informed when a gamepad is disconnected, you can add a handler to the window usingaddEventListener(), like this:

js
window.addEventListener("gamepaddisconnected", (event) => {  console.log("Lost connection with the gamepad.");});

Alternatively, you can use thewindow.ongamepaddisconnected event handler property to establish a handler for thegamepaddisconnected event:

js
window.ongamepaddisconnected = (event) => {  console.log("Lost connection with the gamepad.");};

Specifications

Specification
Gamepad
# event-gamepaddisconnected

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp