Scroll to navigation

SDL_SetJoystickSensorEnabled(3) SDL3 FUNCTIONS SDL_SetJoystickSensorEnabled(3)

NAME

SDL_SetJoystickSensorEnabled - Set whether data reporting for a joystick sensor is enabled.

SYNOPSIS

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

DESCRIPTION

Sensors are disabled by default and this function is used to enable them.

FUNCTION PARAMETERS

the joystick to update.
the type of sensor to enable/disable.
whether data reporting should be enabled.

RETURN VALUE

Returns true on success or false on failure; call SDL_GetError() for more information.

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_JoystickHasSensor(3), SDL_JoystickSensorEnabled(3)

SDL 3.5.0 Simple Directmedia Layer