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<{}>>;
          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.

      • Optional gamepadModelMap?: Readonly<Readonly<{}>>

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

      • Optional layouts?: readonly Readonly<GamepadLayout>[]

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

      • Optional systemVersions?: Readonly<Readonly<{
            browserName: string;
            browserVersion: string;
            osName: string;
            osVersion: string;
        }>>

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

    Returns GamepadLayout | undefined