Fix Xbox One controller support on linux

This commit is contained in:
Maschell 2020-09-05 12:36:24 +02:00
parent 7d38366aa0
commit 693c3184c3
1 changed files with 2 additions and 1 deletions

View File

@ -48,7 +48,8 @@ bool ControllerManager::attachJoystick(int32_t deviceId) {
auto channel = GuiTrigger::CHANNEL_2;
while (channel != GuiTrigger::CHANNEL_ALL) {
if (controllerList.find(channel) == controllerList.end()) {
if (std::string(SDL_JoystickName(joystick)).find("Xbox") != std::string::npos) {
if (std::string(SDL_JoystickName(joystick)).find("Xbox") != std::string::npos
|| std::string(SDL_JoystickName(joystick)).find("X-Box") != std::string::npos) {
controllerList[channel] = new SDLControllerXboxOne(channel);
} else if (std::string(SDL_JoystickName(joystick)).find("WiiU Pro Controller") != std::string::npos) {
controllerList[channel] = new SDLControllerWiiUProContoller(channel);