Scroll to navigation

SDL_JoystickHasSensor(3) SDL3 FUNCTIONS SDL_JoystickHasSensor(3)

NAME

SDL_JoystickHasSensor - Return whether a joystick has a particular sensor.

SYNOPSIS

#include <SDL3/SDL_joystick.h>
bool SDL_JoystickHasSensor(SDL_Joystick *joystick, SDL_SensorType type);

DESCRIPTION

Sensors are disabled by default and SDL_SetJoystickSensorEnabled() is used to enable them.

FUNCTION PARAMETERS

the joystick to query.
the type of sensor to query.

RETURN VALUE

Returns true if the sensor exists, false otherwise.

THREAD SAFETY

It is safe to call this function from any thread.

AVAILABILITY

This function is available since SDL 3.6.0.

SEE ALSO

SDL_GetJoystickSensorData(3), SDL_GetJoystickSensorDataRate(3), SDL_SetJoystickSensorEnabled(3)

SDL 3.5.0 Simple Directmedia Layer