diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index d417a44ba7..59030efff1 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -1033,7 +1033,14 @@ static ControllerMapping_t *SDL_PrivateGetControllerMappingForNameAndGUID(const } } #endif /* __LINUX__ */ - +#ifdef SDL_JOYSTICK_XBOX + if (!mapping) { + SDL_bool existing; + mapping = SDL_PrivateAddMappingForGUID(guid, +"default,Original Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", + &existing, SDL_CONTROLLER_MAPPING_PRIORITY_DEFAULT); + } +#endif /* SDL_JOYSTICK_XBOX */ if (!mapping && name) { if (SDL_strstr(name, "Xbox") || SDL_strstr(name, "X-Box") || SDL_strstr(name, "XBOX")) { mapping = s_pXInputMapping;