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 May 9, 2019
1 parent cd2b624 commit 2913adf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/joystick/SDL_gamecontrollerdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,9 @@ static const char *s_ControllerMappings [] =
#endif
#if defined(SDL_JOYSTICK_EMSCRIPTEN)
"default,Standard Gamepad,a:b0,b:b1,back:b8,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b16,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
#endif
#if defined(SDL_JOYSTICK_XBOX)
"00000000000000000000000000000000,*,a:b0,b:b1,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,",
#endif
"hidapi,*,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
NULL
Expand Down
8 changes: 4 additions & 4 deletions src/joystick/xbox/SDL_xboxjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ static void SDL_XBOX_JoystickDetect() {
static const char* SDL_XBOX_JoystickNameForDeviceIndex(int i) {
switch (i) {
case 0:
return "Pad 1";
return "Xbox Pad 1";
case 1:
return "Pad 2";
return "Xbox Pad 2";
case 2:
return "Pad 3";
return "Xbox Pad 3";
case 3:
return "Pad 4";
return "Xbox Pad 4";
default:
/* FIXME?: NXDK does not yet support more than 4 gamepads */
assert(false);
Expand Down

0 comments on commit 2913adf

Please sign in to comment.