getMappingForId static method

Pointer<Int8> getMappingForId(
  1. int instanceId
)

Get the mapping of a gamepad.

This can be called before any gamepads are opened.

\param instance_id the joystick instance ID. \returns the mapping string. Returns NULL if no mapping is available. This should be freed with SDL_free() when it is no longer needed.

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

\since This function is available since SDL 3.2.0.

\sa SDL_GetGamepads \sa SDL_GetGamepadMapping

extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMappingForID(SDL_JoystickID instance_id)

{@category gamepad}

Implementation

static Pointer<Int8> getMappingForId(int instanceId) =>
    sdlGetGamepadMappingForId(instanceId);