Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow applications to send custom effects to the PS4 and PS5 controllers

See testgamecontroller.c for an example of a custom PS5 trigger effect
This commit is contained in:
Sam Lantinga 2021-07-08 13:22:41 -07:00
parent 073cbc40cb
commit d135c0762f
36 changed files with 533 additions and 186 deletions

View file

@ -1089,6 +1089,12 @@ LINUX_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue)
return SDL_Unsupported();
}
static int
LINUX_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size)
{
return SDL_Unsupported();
}
static int
LINUX_JoystickSetSensorsEnabled(SDL_Joystick *joystick, SDL_bool enabled)
{
@ -1603,6 +1609,7 @@ SDL_JoystickDriver SDL_LINUX_JoystickDriver =
LINUX_JoystickRumbleTriggers,
LINUX_JoystickHasLED,
LINUX_JoystickSetLED,
LINUX_JoystickSendEffect,
LINUX_JoystickSetSensorsEnabled,
LINUX_JoystickUpdate,
LINUX_JoystickClose,