Skip to content

Commit

Permalink
joystick: Add nxdk GameController support
Browse files Browse the repository at this point in the history
  • Loading branch information
dracc committed Jul 4, 2019
1 parent 3241acf commit 0761259
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/joystick/SDL_gamecontroller.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0761259

Please sign in to comment.