This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The ongamepaddisconnected
property of the Window
interface represents an event handler that will run when a gamepad is disconnected (when the gamepaddisconnected
event fires).
The event object is of type GamepadEvent
.
Syntax
window.ongamepaddisconnected = function() { ... };
Examples
window.ongamepaddisconnected = function() {
// A gamepad has been disconnected
};
Specifications
Specification | Status | Comment |
---|---|---|
Gamepad The definition of 'gamepaddisconnected event' in that specification. |
Working Draft | Initial definition |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ongamepaddisconnected | Chrome
Full support
35
| Edge Full support ≤18 | Firefox Full support 29 | IE No support No | Opera
Full support
22
| Safari Full support 10.1 | WebView Android ? | Chrome Android
Full support
35
| Firefox Android Full support 32 | Opera Android
Full support
22
| Safari iOS No support No | Samsung Internet Android
Full support
3.0
|
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
- The Gamepad API by Ted Mielczarek and Robert Nyman
- Simple API demo page (source)