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
BCD tables only load in the browser