interface Navigator { }; interface Event { };
interface Gamepad { readonly attribute DOMString id; readonly attribute long index; readonly attribute boolean connected; readonly attribute DOMHighResTimeStamp timestamp; readonly attribute GamepadMappingType mapping; readonly attribute FrozenArrayaxes; readonly attribute FrozenArray buttons; }; enum GamepadMappingType { "", "standard" }; interface GamepadButton { readonly attribute boolean pressed; readonly attribute double value; }; [Constructor(DOMString type, optional GamepadEventInit eventInitDict)] interface GamepadEvent : Event { readonly attribute Gamepad? gamepad; }; dictionary GamepadEventInit : EventInit { Gamepad? gamepad = null; }; partial interface Navigator { Gamepad[] getGamepads(); };
This test requires a gamepad. Connect one and press any button to start the test.