mirror of https://github.com/encounter/SDL.git
Only use the default Xbox mapping on Linux
On Windows, this is already covered by XInput and is the wrong mapping if we try to use it with DirectInput/RAWINPUT/WGI controllers
This commit is contained in:
parent
74aa4b635c
commit
993a56766d
|
@ -1161,15 +1161,12 @@ static ControllerMapping_t *SDL_PrivateGetControllerMappingForNameAndGUID(const
|
||||||
mapping = SDL_PrivateAddMappingForGUID(guid,
|
mapping = SDL_PrivateAddMappingForGUID(guid,
|
||||||
"none,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3",
|
"none,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3",
|
||||||
&existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT);
|
&existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT);
|
||||||
|
} else if (SDL_strstr(name, "Xbox") || SDL_strstr(name, "X-Box") || SDL_strstr(name, "XBOX")) {
|
||||||
|
mapping = s_pXInputMapping;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* __LINUX__ */
|
#endif /* __LINUX__ */
|
||||||
|
|
||||||
if (!mapping && name && !SDL_IsJoystickWGI(guid)) {
|
|
||||||
if (SDL_strstr(name, "Xbox") || SDL_strstr(name, "X-Box") || SDL_strstr(name, "XBOX")) {
|
|
||||||
mapping = s_pXInputMapping;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!mapping) {
|
if (!mapping) {
|
||||||
mapping = s_pDefaultMapping;
|
mapping = s_pDefaultMapping;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue