Skip to content

Commit

Permalink
fix devices in the patcher
Browse files Browse the repository at this point in the history
  • Loading branch information
pionere committed Oct 1, 2023
1 parent 0fe509f commit 8dcfb83
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions tools/patcher/controls/devices/joystick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ ControllerButton Joystick::ToControllerButton(const SDL_Event& event)
switch (event.jbutton.button) {
#ifdef JOY_BUTTON_A
case JOY_BUTTON_A:
return ControllerButton_BUTTON_A;
return ControllerButton_BUTTON_FACE_BOTTOM;
#endif
#ifdef JOY_BUTTON_B
case JOY_BUTTON_B:
return ControllerButton_BUTTON_B;
return ControllerButton_BUTTON_FACE_RIGHT;
#endif
#ifdef JOY_BUTTON_X
case JOY_BUTTON_X:
return ControllerButton_BUTTON_X;
return ControllerButton_BUTTON_FACE_LEFT;
#endif
#ifdef JOY_BUTTON_Y
case JOY_BUTTON_Y:
return ControllerButton_BUTTON_Y;
return ControllerButton_BUTTON_FACE_TOP;
#endif
#ifdef JOY_BUTTON_LEFTSTICK
case JOY_BUTTON_LEFTSTICK:
Expand Down Expand Up @@ -118,19 +118,19 @@ int Joystick::ToSdlJoyButton(ControllerButton button)
case ControllerButton_IGNORE:
break;
#ifdef JOY_BUTTON_A
case ControllerButton_BUTTON_A:
case ControllerButton_BUTTON_FACE_BOTTOM:
return JOY_BUTTON_A;
#endif
#ifdef JOY_BUTTON_B
case ControllerButton_BUTTON_B:
case ControllerButton_BUTTON_FACE_RIGHT:
return JOY_BUTTON_B;
#endif
#ifdef JOY_BUTTON_X
case ControllerButton_BUTTON_X:
case ControllerButton_BUTTON_FACE_LEFT:
return JOY_BUTTON_X;
#endif
#ifdef JOY_BUTTON_Y
case ControllerButton_BUTTON_Y:
case ControllerButton_BUTTON_FACE_TOP:
return JOY_BUTTON_Y;
#endif
#ifdef JOY_BUTTON_BACK
Expand Down
20 changes: 10 additions & 10 deletions tools/patcher/controls/devices/kbcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ ControllerButton KbCtrlToControllerButton(const SDL_Event& event)
#endif
#ifdef KBCTRL_BUTTON_A
case KBCTRL_BUTTON_A:
return ControllerButton_BUTTON_A;
return ControllerButton_BUTTON_FACE_BOTTOM;
#endif
#ifdef KBCTRL_BUTTON_B
case KBCTRL_BUTTON_B: // Right button
return ControllerButton_BUTTON_B;
case KBCTRL_BUTTON_B:
return ControllerButton_BUTTON_FACE_RIGHT;
#endif
#ifdef KBCTRL_BUTTON_X
case KBCTRL_BUTTON_X: // Left button
return ControllerButton_BUTTON_X;
case KBCTRL_BUTTON_X:
return ControllerButton_BUTTON_FACE_LEFT;
#endif
#ifdef KBCTRL_BUTTON_Y
case KBCTRL_BUTTON_Y:
return ControllerButton_BUTTON_Y;
return ControllerButton_BUTTON_FACE_TOP;
#endif
#ifdef KBCTRL_BUTTON_LEFTSTICK
case KBCTRL_BUTTON_LEFTSTICK:
Expand Down Expand Up @@ -93,19 +93,19 @@ static SDL_Keycode ControllerButtonToKbCtrlKeyCode(ControllerButton button)
{
switch (button) {
#ifdef KBCTRL_BUTTON_A
case ControllerButton_BUTTON_A:
case ControllerButton_BUTTON_FACE_BOTTOM:
return KBCTRL_BUTTON_A;
#endif
#ifdef KBCTRL_BUTTON_B
case ControllerButton_BUTTON_B:
case ControllerButton_BUTTON_FACE_RIGHT:
return KBCTRL_BUTTON_B;
#endif
#ifdef KBCTRL_BUTTON_X
case ControllerButton_BUTTON_X:
case ControllerButton_BUTTON_FACE_LEFT:
return KBCTRL_BUTTON_X;
#endif
#ifdef KBCTRL_BUTTON_Y
case ControllerButton_BUTTON_Y:
case ControllerButton_BUTTON_FACE_TOP:
return KBCTRL_BUTTON_Y;
#endif
#ifdef KBCTRL_BUTTON_BACK
Expand Down

0 comments on commit 8dcfb83

Please sign in to comment.