 {
    idl_array.add_objects({
      Gamepad: ['gamepad'],
      GamepadButton: ['gamepadButton'],
      GamepadEvent: ['event'],
      Navigator: ['navigator']
    });

    const eventWatcher = new EventWatcher(t, window, "gamepadconnected");
    const gamepadConnected = eventWatcher.wait_for("gamepadconnected")
        .then(e => {
          self.event = e;
          self.gamepad = e.gamepad;
          self.gamepadButton = e.gamepad.buttons[0];
        });

    const timeout = new Promise((_, reject) => {