I volontari di MDN non hanno ancora tradotto questo articolo in Italiano. Unisciti a noi e traducilo tu stesso.
Puoi anche consultare l’articolo in English (US).

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The ongamepadconnected property of the Window interface represents an event handler that will run when a gamepad is connected (when the gamepadconnected event fires).

The event object is of type GamepadEvent.

Syntax

window.ongamepadconnected = function() { ... };

Examples

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

Specifications

Specification Status Comment
Unknown
The definition of 'gamepadconnected event' in that specification.
Working Draft Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 35
Full support 35
No support 21 — 35
Prefixed
Prefixed Requires the vendor prefix: webkit
Edge Full support YesFirefox Full support 29IE No support NoOpera Full support 22
Full support 22
No support 15 — 22
Prefixed
Prefixed Requires the vendor prefix: webkit
Safari Full support 10.1WebView Android ? Chrome Android ? Edge Mobile Full support YesFirefox Android Full support 32Opera Android No support NoSafari iOS No support NoSamsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also

Tag del documento e collaboratori

Hanno collaborato alla realizzazione di questa pagina: wbamberg, chrisdavidmills
Ultima modifica di: wbamberg,