Start rumbling once a raw input controller has been correlated

Fixes https://github.com/libsdl-org/SDL/issues/5351
This commit is contained in:
Sam Lantinga 2022-03-17 18:25:50 -07:00
parent 3167ba342d
commit 1868c5b521
2 changed files with 27 additions and 18 deletions

View file

@ -1295,6 +1295,13 @@ RAWINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uin
}
#endif /* SDL_JOYSTICK_RAWINPUT_XINPUT */
if (!rumbled) {
#if defined(SDL_JOYSTICK_RAWINPUT_WGI) || defined(SDL_JOYSTICK_RAWINPUT_XINPUT)
return SDL_SetError("Controller isn't correlated yet, try hitting a button first");
#else
return SDL_Unsupported();
#endif
}
return 0;
}