Skip to content

Commit

Permalink
SDLInputSource: Add new gamepad buttons
Browse files Browse the repository at this point in the history
Also add asserts to ensure name arrays match the length of the SDL enums
  • Loading branch information
TheLastRar committed Feb 18, 2025
1 parent f43804d commit f0f8731
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pcsx2/Input/SDLInputSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ static constexpr const char* s_sdl_axis_names[] = {
"LeftTrigger", // SDL_GAMEPAD_AXIS_LEFT_TRIGGER
"RightTrigger", // SDL_GAMEPAD_AXIS_RIGHT_TRIGGER
};
static_assert(std::size(s_sdl_axis_names) == SDL_GAMEPAD_AXIS_COUNT);

static constexpr const char* s_sdl_axis_icons[][2] = {
{ICON_PF_LEFT_ANALOG_LEFT, ICON_PF_LEFT_ANALOG_RIGHT}, // SDL_GAMEPAD_AXIS_LEFTX
{ICON_PF_LEFT_ANALOG_UP, ICON_PF_LEFT_ANALOG_DOWN}, // SDL_GAMEPAD_AXIS_LEFTY
Expand Down Expand Up @@ -86,7 +88,13 @@ static constexpr const char* s_sdl_button_names[] = {
"Paddle3", // SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2
"Paddle4", // SDL_GAMEPAD_BUTTON_LEFT_PADDLE2
"Touchpad", // SDL_GAMEPAD_BUTTON_TOUCHPAD
"Misc2", // SDL_GAMEPAD_BUTTON_MISC2
"Misc3", // SDL_GAMEPAD_BUTTON_MISC3
"Misc4", // SDL_GAMEPAD_BUTTON_MISC4
"Misc5", // SDL_GAMEPAD_BUTTON_MISC5
"Misc6", // SDL_GAMEPAD_BUTTON_MISC6
};
static_assert(std::size(s_sdl_button_names) == SDL_GAMEPAD_BUTTON_COUNT);

static constexpr const char* s_sdl_face_button_icons[] = {
nullptr, // SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN
Expand Down

0 comments on commit f0f8731

Please sign in to comment.