Window.ongamepaddisconnected
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.
解析
window.ongamepaddisconnected = function() { ... };
示例
js
window.ongamepaddisconnected = function() {
// A gamepad has been disconnected
};
Specifications
| Specification |
|---|
| Gamepad # event-gamepaddisconnected |
Browser compatibility
BCD tables only load in the browser
See also
- The Gamepad API by Ted Mielczarek and Robert Nyman
- Simple API demo page (source)