RMG-Input: add 'SDL controller mode' option

This commit is contained in:
Rosalie Wanders committed 2024-07-28 14:44:55 +02:00
1 parent e112e324f7
commit 9b5cc05b9f
3 files changed
+60 -2

No files matched your search

@@ -139,12 +139,14 @@ void MainDialog::openInputDevice(QString deviceName, int deviceNum)
}
}
if (SDL_IsGameController(deviceNum) == SDL_TRUE)
int controllerMode = CoreSettingsGetIntValue(SettingsID::Input_ControllerMode);
if ((controllerMode == 0 && SDL_IsGameController(deviceNum) == SDL_TRUE) ||
(controllerMode == 2))
{
this->currentJoystick = nullptr;
this->currentController = SDL_GameControllerOpen(deviceNum);
}
else
else if (controllerMode == 0 || controllerMode == 1)
{
this->currentJoystick = SDL_JoystickOpen(deviceNum);
this->currentController = nullptr;