From c5c023af5fc58594dcdbbb1b8a96a5330f5b6c6d Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 8 Jan 2024 15:48:34 +1000 Subject: [PATCH] SDLInputSource: Log axes/buttons when controller is opened --- src/util/sdl_input_source.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/sdl_input_source.cpp b/src/util/sdl_input_source.cpp index a8150f2cc..17cc698eb 100644 --- a/src/util/sdl_input_source.cpp +++ b/src/util/sdl_input_source.cpp @@ -705,6 +705,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))); + + Log_VerbosePrintf("(SDLInputSource) Controller %d has %d axes and %d buttons", player_id, num_axes, num_buttons); } else { @@ -712,6 +714,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)); + + Log_VerbosePrintf("(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);