From 436fba77ac69f9ba465ec69290cc2883f60ab2f2 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 7 Jan 2024 13:13:48 +1000 Subject: [PATCH] SDLInputSource: Log axes/buttons when controller is opened --- pcsx2/Input/SDLInputSource.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pcsx2/Input/SDLInputSource.cpp b/pcsx2/Input/SDLInputSource.cpp index 78e9ab48e1..2f58cab9c6 100644 --- a/pcsx2/Input/SDLInputSource.cpp +++ b/pcsx2/Input/SDLInputSource.cpp @@ -630,7 +630,6 @@ bool SDLInputSource::OpenDevice(int index, bool is_gamecontroller) if (!gcontroller && !joystick) { Console.Error("(SDLInputSource) Failed to open controller %d", index); - return false; } @@ -689,6 +688,8 @@ bool SDLInputSource::OpenDevice(int index, bool is_gamecontroller) mark_bind(SDL_GameControllerGetBindForAxis(gcontroller, static_cast(i))); for (size_t i = 0; i < std::size(s_sdl_button_names); i++) mark_bind(SDL_GameControllerGetBindForButton(gcontroller, static_cast(i))); + + Console.WriteLn("(SDLInputSource) Controller %d has %d axes and %d buttons", player_id, num_axes, num_buttons); } else { @@ -696,6 +697,9 @@ bool SDLInputSource::OpenDevice(int index, bool is_gamecontroller) const int num_hats = SDL_JoystickNumHats(joystick); if (num_hats > 0) cd.last_hat_state.resize(static_cast(num_hats), u8(0)); + + Console.WriteLn("(SDLInputSource) Joystick %d has %d axes, %d buttons and %d hats", player_id, + SDL_JoystickNumAxes(joystick), SDL_JoystickNumButtons(joystick), num_hats); } cd.use_game_controller_rumble = (gcontroller && SDL_GameControllerRumble(gcontroller, 0, 0, 0) == 0);