Function findMatchingGamepadLayout

  • Given a gamepad name, tries to find the best matching predefined or custom gamepad layout based on system versions. Returns undefined if no possible matches are found.

    Parameters

    • __namedParameters: {
          gamepad: undefined | string | Readonly<Pick<Readonly<{}>, "deviceName">>;
          gamepadModelMap?: Readonly<Readonly<{ [key: string]: string }>>;
          layouts?: readonly Readonly<GamepadLayout>[];
          systemVersions?: Readonly<
              Readonly<
                  {
                      browserName: string;
                      browserVersion: string;
                      osName: string;
                      osVersion: string;
                  },
              >,
          >;
      }
      • gamepad: undefined | string | Readonly<Pick<Readonly<{}>, "deviceName">>

        The gamepad to match for.

      • OptionalgamepadModelMap?: Readonly<Readonly<{ [key: string]: string }>>

        Provide custom gamepad model maps. Defaults to this package's predefined model map.

      • Optionallayouts?: readonly Readonly<GamepadLayout>[]

        Provide custom layouts. Defaults to this package's predefined layouts.

      • OptionalsystemVersions?: Readonly<
            Readonly<
                {
                    browserName: string;
                    browserVersion: string;
                    osName: string;
                    osVersion: string;
                },
            >,
        >

        Provide custom system versions. Defaults to the current system's system versions.

    Returns undefined | GamepadLayout