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

@ -782,6 +782,16 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick);
*/
extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue);
/**
* Send a joystick specific effect packet
*
* \param joystick The joystick to affect
* \param data The data to send to the joystick
* \param size The size of the data to send to the joystick
* \returns 0, or -1 if this joystick or driver doesn't support effect packets
*/
extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size);
/**
* Close a joystick previously opened with SDL_JoystickOpen().
*