Window: gamepadconnected 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.

The gamepadconnected event is fired when the browser detects that a gamepad has been connected or the first time a button/axis of the gamepad is used.

The event will not fire if disallowed by the document's gamepad Permissions Policy.

This event is not cancelable and does not bubble.

Syntax

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

js
addEventListener("gamepadconnected", (event) => { })

ongamepadconnected = (event) => { }

Examples

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

js
window.addEventListener("gamepadconnected", (event) => {
  // All buttons and axes values can be accessed through
  const gamepad = event.gamepad;
});

Alternatively, you can use the window.ongamepadconnected event handler property to establish a handler for the gamepadconnected event:

js
window.ongamepadconnected = (event) => {
  // All buttons and axes values can be accessed through
  const gamepad = event.gamepad;
};

Specifications

Specification
Gamepad
# event-gamepadconnected

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
gamepadconnected event
Chrome – Partial support
Chrome 35 – 142 (Release date: 2014-05-20)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 40175074.
Chrome – Full support
Chrome 143 (Release date: 2025-12-02)
footnote Full support
Edge – Partial support
Edge 18 – 142 (Release date: 2018-10-02)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 40175074.
Edge – Full support
Edge 143 (Release date: 2025-12-05)
footnote Full support
Firefox – Partial support
Firefox 29 – 88 (Release date: 2014-04-29)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 1697093.
Firefox – Full support
Firefox 89 (Release date: 2021-06-01)
footnote Full support
Opera – Partial support
Opera 22 – 126 (Release date: 2014-06-03)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 40175074.
Opera – Full support
Opera 127 (Release date: 2026-02-02)
footnote Full support
Safari – Partial support
Safari 10.1 – 15.6 (Release date: 2017-03-27)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 223860.
Safari – Full support
Safari 16 (Release date: 2022-09-12)
footnote Full support
Chrome Android – Partial support
Chrome Android 37 – 142 (Release date: 2014-09-03)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 40175074.
Chrome Android – Full support
Chrome Android 143 (Release date: 2025-12-02)
footnote Full support
Firefox for Android – Partial support
Firefox for Android 32 – 88 (Release date: 2014-09-02)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 1697093.
Firefox for Android – Full support
Firefox for Android 89 (Release date: 2021-06-01)
footnote Full support
Opera Android – Partial support
Opera Android 24 – 93 (Release date: 2014-09-10)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 40175074.
Opera Android – Full support
Opera Android 94 (Release date: 2026-01-13)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 10.3 – 15.6 (Release date: 2017-03-27)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 223860.
Safari on iOS – Full support
Safari on iOS 16 (Release date: 2022-09-12)
footnote Full support
Samsung Internet – Partial support
Samsung Internet 3 (Release date: 2015-04-10)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 40175074.
WebView Android – Partial support
WebView Android 37 – 142 (Release date: 2014-09-03)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 40175074.
WebView Android – Full support
WebView Android 143 (Release date: 2025-12-02)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 10.3 – 15.6 (Release date: 2017-03-27)
footnote Partial support
footnote The ongamepadconnected event handler property is not supported. See bug 223860.
WebView on iOS – Full support
WebView on iOS 16 (Release date: 2022-09-12)
footnote Full support
Deno – No support
Deno
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support
Has more compatibility info.

See also