From c8ab33eb3cd424823a6b3a412d08c484b00c2ccb Mon Sep 17 00:00:00 2001 From: shygoo Date: Sun, 5 May 2019 00:10:57 -0500 Subject: [PATCH] [N-Rage] Make background input stable --- Source/nragev20/NRagePluginV2.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Source/nragev20/NRagePluginV2.cpp b/Source/nragev20/NRagePluginV2.cpp index b01de8fd7..c2054de72 100644 --- a/Source/nragev20/NRagePluginV2.cpp +++ b/Source/nragev20/NRagePluginV2.cpp @@ -539,14 +539,7 @@ EXPORT void CALL GetKeys(int Control, BUTTONS * Keys ) #ifdef ENABLE_RAWPAK_DEBUG DebugWriteA("CALLED: GetKeys\n"); #endif - - if( !g_pcControllers[Control].bBackgroundInput && GetForegroundWindow() != g_strEmuInfo.hMainWindow ) - { - // cancel if main window isn't focused and background input is disabled - return; - } - - if( g_bConfiguring ) + if( g_bConfiguring || (!g_pcControllers[Control].bBackgroundInput && GetForegroundWindow() != g_strEmuInfo.hMainWindow) ) Keys->Value = 0; else { @@ -691,7 +684,8 @@ EXPORT void CALL ReadController( int Control, BYTE * Command ) // expected: controller gets 1 byte (command), controller sends back 4 bytes // should be: Command[0] == 0x01 // Command[1] == 0x04 - if( g_bConfiguring ) + + if( g_bConfiguring || (!g_pcControllers[Control].bBackgroundInput && GetForegroundWindow() != g_strEmuInfo.hMainWindow) ) Command[3] = Command[4] = Command[5] = Command[6] = 0; else {