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.

Bubbles No
Cancelable No
Interface GamepadEvent
Event handler property ongamepadconnected

Examples

window.addEventListener('gamepadconnected', event => {

    // All buttons and axes values can be accessed through
    event.gamepad;

});

Specifications

Specification Status
Gamepad Working Draft

Browser compatibility

No compatibility data found. Please contribute data for "api.Window.gamepadconnected" (depth: 1) to the MDN compatibility data repository.

See also

Document Tags and Contributors

Last updated by: irenesmith,