diff --git a/Core/Config.cpp b/Core/Config.cpp index 1c0f821b30..6740b8b3ac 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -783,6 +783,7 @@ static ConfigSetting controlSettings[] = { ConfigSetting("DInputAnalogInverseMode", &g_Config.iDInputAnalogInverseMode, 0, true, true), ConfigSetting("DInputAnalogInverseDeadzone", &g_Config.fDInputAnalogInverseDeadzone, 0.0f, true, true), ConfigSetting("DInputAnalogSensitivity", &g_Config.fDInputAnalogSensitivity, 1.0f, true, true), + ConfigSetting("EnableDInputWithXInput", &g_Config.bEnableDInputWithXInput, false, true, true), ConfigSetting("XInputAnalogDeadzone", &g_Config.fXInputAnalogDeadzone, 0.24f, true, true), ConfigSetting("XInputAnalogInverseMode", &g_Config.iXInputAnalogInverseMode, 0, true, true), diff --git a/Core/Config.h b/Core/Config.h index fd1508e38a..9936d84a2a 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -330,6 +330,7 @@ public: int iDInputAnalogInverseMode; float fDInputAnalogInverseDeadzone; float fDInputAnalogSensitivity; + bool bEnableDInputWithXInput; // We also use the XInput settings as analog settings on other platforms like Android. float fXInputAnalogDeadzone; diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 1953f6163e..559fb6e7f7 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -577,6 +577,8 @@ void GameSettingsScreen::CreateViews() { if (!g_Config.bSimpleUI) { #if defined(USING_WIN_UI) controlsSettings->Add(new CheckBox(&g_Config.bGamepadOnlyFocused, co->T("Ignore gamepads when not focused"))); + controlsSettings->Add(new CheckBox(&g_Config.bEnableDInputWithXInput, co->T("Enable Dinput along Xinput","Enable Dinput along Xinput gamepads(might cause problems with gamepads that can use both without manual switch)"))); + #endif auto axisToButton = new PopupSliderChoiceFloat(&g_Config.fAxisBindThreshold, 0.01f, 0.96f, co->T("Axis to button threshold"), 0.05f, screenManager()); controlsSettings->Add(axisToButton); diff --git a/Windows/XinputDevice.cpp b/Windows/XinputDevice.cpp index 575f4891d4..e0defafe39 100644 --- a/Windows/XinputDevice.cpp +++ b/Windows/XinputDevice.cpp @@ -240,7 +240,7 @@ int XinputDevice::UpdateState() { // If we get XInput, skip the others. This might not actually be a good idea, // and was done to avoid conflicts between DirectInput and XInput. - return anySuccess ? UPDATESTATE_SKIP_PAD : 0; + return anySuccess ? (g_Config.bEnableDInputWithXInput ? 0 : UPDATESTATE_SKIP_PAD) : 0; } void XinputDevice::UpdatePad(int pad, const XINPUT_STATE &state) {