mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-05 01:09:14 +00:00
Fix false positives in SDL_GameControllerRumble() support detection
This commit is contained in:
parent
519473e498
commit
2cb3a132c6
1 changed files with 4 additions and 2 deletions
|
@ -999,8 +999,10 @@ void SdlInputHandler::handleControllerDeviceEvent(SDL_ControllerDeviceEvent* eve
|
|||
state->jsId = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(state->controller));
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 9)
|
||||
// Perform a no-op rumble to see if haptics are supported
|
||||
hapticCaps = SDL_GameControllerRumble(controller, 0, 0, 0) == 0 ?
|
||||
// Perform a tiny rumble to see if haptics are supported.
|
||||
// NB: We cannot use zeros for rumble intensity or SDL will not actually call the JS driver
|
||||
// and we'll get a (potentially false) success value returned.
|
||||
hapticCaps = SDL_GameControllerRumble(controller, 1, 1, 1) == 0 ?
|
||||
ML_HAPTIC_GC_RUMBLE : 0;
|
||||
#else
|
||||
state->haptic = SDL_HapticOpenFromJoystick(SDL_GameControllerGetJoystick(state->controller));
|
||||
|
|
Loading…
Reference in a new issue