diff --git a/rpcs3/ds4_pad_handler.cpp b/rpcs3/ds4_pad_handler.cpp index a9219105c0..d87bedf76f 100644 --- a/rpcs3/ds4_pad_handler.cpp +++ b/rpcs3/ds4_pad_handler.cpp @@ -5,6 +5,10 @@ #include #include +#ifdef _WIN32 +#include +#endif + namespace { const auto THREAD_SLEEP = 1ms; //ds4 has new data every ~4ms, @@ -394,6 +398,17 @@ void ds4_pad_handler::ProcessData() pad.m_buttons[12 + i - 4].m_value = pressed ? 255 : 0; } +#ifdef _WIN32 + for (int i = 6; i < 16; i++) + { + if (pad.m_buttons[i].m_pressed) + { + SetThreadExecutionState(ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); + break; + } + } +#endif + // these values come already calibrated from our ds4Thread, // all we need to do is convert to ds3 range diff --git a/rpcs3/xinput_pad_handler.cpp b/rpcs3/xinput_pad_handler.cpp index fc196fd7f1..97798c2f6e 100644 --- a/rpcs3/xinput_pad_handler.cpp +++ b/rpcs3/xinput_pad_handler.cpp @@ -215,6 +215,15 @@ DWORD xinput_pad_handler::ThreadProcedure() pad.m_buttons[j].m_value = pressed ? 255 : 0; } + for (int i = 6; i < 16; i++) + { + if (pad.m_buttons[i].m_pressed) + { + SetThreadExecutionState(ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); + break; + } + } + pad.m_buttons[XINPUT_GAMEPAD_BUTTONS].m_pressed = state.Gamepad.bLeftTrigger > 0; pad.m_buttons[XINPUT_GAMEPAD_BUTTONS].m_value = state.Gamepad.bLeftTrigger; pad.m_buttons[XINPUT_GAMEPAD_BUTTONS + 1].m_pressed = state.Gamepad.bRightTrigger > 0;