getProductForId static method

int getProductForId(
  1. int instanceId
)

Get the USB product ID of a gamepad, if available.

This can be called before any gamepads are opened. If the product ID isn't available this function returns 0.

\param instance_id the joystick instance ID. \returns the USB product ID of the selected gamepad. If called on an invalid index, this function returns zero.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.2.0.

\sa SDL_GetGamepadProduct \sa SDL_GetGamepads

extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductForID(SDL_JoystickID instance_id)

{@category gamepad}

Implementation

static int getProductForId(int instanceId) =>
    sdlGetGamepadProductForId(instanceId);