diff --git a/src/common/settings.h b/src/common/settings.h index 00ba7dddc9..7bcec7e3ba 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -702,7 +702,15 @@ struct Values { // Controls InputSetting> players; - + Setting disable_wgi_xinput{ + linkage, false, "disable_wgi_xinput", Category::Controls, Specialization::Default, +// Only read/write disable_wgi_xinput on Windows platforms +#ifdef _WIN32 + true +#else + false +#endif + }; Setting enable_raw_input{ linkage, false, "enable_raw_input", Category::Controls, Specialization::Default, // Only read/write enable_raw_input on Windows platforms diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index a656dcf077..dd7e8edc30 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp @@ -648,6 +648,13 @@ SDLDriver::SDLDriver(std::string input_engine_) : InputEngine(std::move(input_en // Disable raw input. When enabled this setting causes SDL to die when a web applet opens SDL_SetHint(SDL_HINT_JOYSTICK_RAWINPUT, Settings::values.enable_raw_input ? "1" : "0"); +#ifdef _WIN32 + if (Settings::values.disable_wgi_xinput) { + SDL_SetHintWithPriority(SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT, "0", SDL_HINT_OVERRIDE); + SDL_SetHintWithPriority(SDL_HINT_JOYSTICK_WGI, "0", SDL_HINT_OVERRIDE); + } +#endif + // SDL3 defaults Steam Controller Bluetooth HIDAPI support to off, which can disable gyro. SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_STEAM, "1"); SDL_SetHint(SDL_HINT_GAMECONTROLLER_SENSOR_FUSION, "1"); diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp index d8f0ab7e6c..47b30322aa 100644 --- a/src/yuzu/configuration/configure_input_advanced.cpp +++ b/src/yuzu/configuration/configure_input_advanced.cpp @@ -99,6 +99,7 @@ ConfigureInputAdvanced::ConfigureInputAdvanced(Core::HID::HIDCore& hid_core_, QW #ifndef _WIN32 ui->enable_raw_input->setVisible(false); + ui->disable_wgi_xinput->setVisible(false); #endif LoadConfiguration(); @@ -139,6 +140,7 @@ void ConfigureInputAdvanced::ApplyConfiguration() { Settings::values.emulate_analog_keyboard = ui->emulate_analog_keyboard->isChecked(); Settings::values.touchscreen.enabled = ui->touchscreen_enabled->isChecked(); Settings::values.enable_raw_input = ui->enable_raw_input->isChecked(); + Settings::values.disable_wgi_xinput = ui->disable_wgi_xinput->isChecked(); Settings::values.enable_udp_controller = ui->enable_udp_controller->isChecked(); Settings::values.controller_navigation = ui->controller_navigation->isChecked(); Settings::values.enable_ring_controller = ui->enable_ring_controller->isChecked(); @@ -174,6 +176,7 @@ void ConfigureInputAdvanced::LoadConfiguration() { ui->emulate_analog_keyboard->setChecked(Settings::values.emulate_analog_keyboard.GetValue()); ui->touchscreen_enabled->setChecked(Settings::values.touchscreen.enabled); ui->enable_raw_input->setChecked(Settings::values.enable_raw_input.GetValue()); + ui->disable_wgi_xinput->setChecked(Settings::values.disable_wgi_xinput.GetValue()); ui->enable_udp_controller->setChecked(Settings::values.enable_udp_controller.GetValue()); ui->controller_navigation->setChecked(Settings::values.controller_navigation.GetValue()); ui->enable_ring_controller->setChecked(Settings::values.enable_ring_controller.GetValue()); diff --git a/src/yuzu/configuration/configure_input_advanced.ui b/src/yuzu/configuration/configure_input_advanced.ui index f489d93965..a082523216 100644 --- a/src/yuzu/configuration/configure_input_advanced.ui +++ b/src/yuzu/configuration/configure_input_advanced.ui @@ -2757,6 +2757,22 @@ + + + + Aimed to disable SDL GUIDE button hack: synthetic GUIDE(HOME) event when SELECT(MINUS) + START(PLUS) pressed. May impact Win related trigger/rumble/etc stuff + + + + 0 + 23 + + + + Disable SDL WGI/XInput (Requires restart) + + +