joystick: Add capability flags for rumble and trigger rumble

When API limitations force us to guess, we favor a false positive (reporting
support when it doesn't exist) compared to a false negative.
This commit is contained in:
Cameron Gutman
2021-11-11 12:12:05 -06:00
committed by Sam Lantinga
parent 1ccfbf963e
commit afccabb881
18 changed files with 135 additions and 20 deletions

View File

@@ -666,7 +666,14 @@ HIDAPI_DriverPS5_RumbleJoystickTriggers(SDL_HIDAPI_Device *device, SDL_Joystick
static Uint32
HIDAPI_DriverPS5_GetJoystickCapabilities(SDL_HIDAPI_Device *device, SDL_Joystick *joystick)
{
return SDL_JOYCAP_LED;
SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context;
Uint32 result = 0;
if (ctx->enhanced_mode) {
result |= SDL_JOYCAP_LED | SDL_JOYCAP_RUMBLE;
}
return result;
}
static int