diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 6cd6d22eaa5b..11e2f51214ee 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -185,8 +185,6 @@ [code]product_id[/code]: The USB product ID of the device. [code]serial_number[/code]: The serial number of the device. This key won't be present if the serial number is unavailable. [code]steam_input_index[/code]: The Steam Input gamepad index, if the device is not a Steam Input device this key won't be present. - On Windows, the dictionary can have an additional field: - [code]xinput_index[/code]: The index of the controller in the XInput system. This key won't be present for devices not handled by XInput. [b]Note:[/b] The returned dictionary is always empty on Android, iOS, visionOS, and Web. diff --git a/drivers/sdl/SDL_build_config_private.h b/drivers/sdl/SDL_build_config_private.h index d6e6cb72cc87..12e7bf622fee 100644 --- a/drivers/sdl/SDL_build_config_private.h +++ b/drivers/sdl/SDL_build_config_private.h @@ -59,13 +59,11 @@ #define HAVE_LIBC 1 #define HAVE_DINPUT_H 1 #define HAVE_XINPUT_H 1 -#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */ #define HAVE_WINDOWS_GAMING_INPUT_H 1 -#define SDL_JOYSTICK_WGI 1 -#endif #define SDL_JOYSTICK_DINPUT 1 #define SDL_JOYSTICK_HIDAPI 1 #define SDL_JOYSTICK_RAWINPUT 1 +//#define SDL_JOYSTICK_WGI 1 // This driver causes compilation issues. #define SDL_JOYSTICK_XINPUT 1 #define SDL_HAPTIC_DINPUT 1 #define SDL_THREAD_GENERIC_COND_SUFFIX 1 diff --git a/drivers/sdl/joypad_sdl.cpp b/drivers/sdl/joypad_sdl.cpp index 4ecc5db2c98a..f97ac1a791eb 100644 --- a/drivers/sdl/joypad_sdl.cpp +++ b/drivers/sdl/joypad_sdl.cpp @@ -63,6 +63,7 @@ JoypadSDL::~JoypadSDL() { Error JoypadSDL::initialize() { SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1"); + SDL_SetHint(SDL_HINT_JOYSTICK_RAWINPUT, "1"); SDL_SetHint(SDL_HINT_NO_SIGNAL_HANDLERS, "1"); ERR_FAIL_COND_V_MSG(!SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_GAMEPAD), FAILED, SDL_GetError()); @@ -179,14 +180,6 @@ void JoypadSDL::process_events() { joypad_info["steam_input_index"] = itos(steam_handle); } -#ifdef WINDOWS_ENABLED - const int player_index = SDL_GetJoystickPlayerIndex(joy); - if (player_index >= 0 && joy_guid.data[14] == 'x') { // See also "SDL_IsJoystickXInput" in "thirdparty/sdl/joystick/SDL_joystick.c". - // For XInput controllers SDL_GetJoystickPlayerIndex returns the XInput user index. - joypad_info["xinput_index"] = itos(player_index); - } -#endif - Input::get_singleton()->joy_connection_changed( joy_id, true,