SDL_GetJoysticks - Man Page

Get a list of currently connected joysticks.

Synopsis

#include <SDL3/SDL_joystick.h>

SDL_JoystickID * SDL_GetJoysticks(int *count);

Function Parameters

count

a pointer filled in with the number of joysticks returned, may be NULL.

Return Value

Returns a 0 terminated array of joystick instance IDs or NULL on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.

Availability

This function is available since SDL 3.2.0.

See Also

SDL_HasJoystick(3), SDL_OpenJoystick(3)

Referenced By

SDL_GetJoystickNameForID(3), SDL_GetJoystickPathForID(3), SDL_GetJoystickPlayerIndexForID(3), SDL_GetJoystickProductForID(3), SDL_GetJoystickProductVersionForID(3), SDL_GetJoystickTypeForID(3), SDL_GetJoystickVendorForID(3), SDL_HasJoystick(3), SDL_IsGamepad(3).

SDL 3.2.16 Simple Directmedia Layer SDL3 FUNCTIONS