Definition
Gamepad defines Gamepad
[Exposed=Window]
interface Gamepad {
readonly attribute DOMString id;
readonly attribute long index;
readonly attribute boolean connected;
readonly attribute DOMHighResTimeStamp timestamp;
readonly attribute GamepadMappingType mapping;
readonly attribute FrozenArray<double> axes;
readonly attribute FrozenArray<GamepadButton> buttons;
[SameObject] readonly attribute GamepadHapticActuator vibrationActuator;
};
This interface is extended in the following specifications:
- Gamepad Extensions
partial interface Gamepad { readonly attribute GamepadHand hand; readonly attribute FrozenArray<GamepadHapticActuator> hapticActuators; readonly attribute GamepadPose? pose; readonly attribute FrozenArray<GamepadTouch>? touchEvents; };
Consolidated IDL (across mixin and partials)
[Exposed=Window]
interface Gamepad {
readonly attribute DOMString id;
readonly attribute long index;
readonly attribute boolean connected;
readonly attribute DOMHighResTimeStamp timestamp;
readonly attribute GamepadMappingType mapping;
readonly attribute FrozenArray<double> axes;
readonly attribute FrozenArray<GamepadButton> buttons;
[SameObject] readonly attribute GamepadHapticActuator vibrationActuator;
readonly attribute GamepadHand hand;
readonly attribute FrozenArray<GamepadHapticActuator> hapticActuators;
readonly attribute GamepadPose? pose;
readonly attribute FrozenArray<GamepadTouch>? touchEvents;
};
Methods and attributes that return objects implementing Gamepad
Referring IDL interfaces/dictionaries
Referring specifications
- Gamepad Extensions refers to
Gamepad
- WebXR Gamepads Module - Level 1 refers to
Gamepad