2025-08-18 17:27:00 +01:00
|
|
|
#import <DOM/Event.idl>
|
|
|
|
|
#import <Gamepad/Gamepad.idl>
|
|
|
|
|
|
|
|
|
|
// https://w3c.github.io/gamepad/#dom-gamepadevent
|
|
|
|
|
[Exposed=Window]
|
|
|
|
|
interface GamepadEvent : Event {
|
2025-09-02 02:36:19 +01:00
|
|
|
// eventInitDict is not marked as optional in the specification, but existing implementations treat it as optional.
|
|
|
|
|
// See: https://github.com/w3c/gamepad/pull/217
|
|
|
|
|
constructor(DOMString type, optional GamepadEventInit eventInitDict = {});
|
|
|
|
|
[SameObject] readonly attribute Gamepad? gamepad;
|
2025-08-18 17:27:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// https://w3c.github.io/gamepad/#dom-gamepadeventinit
|
|
|
|
|
dictionary GamepadEventInit : EventInit {
|
2025-09-02 02:36:19 +01:00
|
|
|
// This is marked as required in the specification, but existing implementations treat it as optional.
|
|
|
|
|
// See: https://github.com/w3c/gamepad/pull/217
|
|
|
|
|
Gamepad? gamepad = null;
|
2025-08-18 17:27:00 +01:00
|
|
|
};
|