From 47144176ff3e62ee090adbb1ca2c2a124aff076f Mon Sep 17 00:00:00 2001 From: OV2 Date: Sun, 22 Apr 2018 20:06:24 +0200 Subject: [PATCH] win32: detect esc when using backgroundinput --- win32/wsnes9x.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/win32/wsnes9x.cpp b/win32/wsnes9x.cpp index f0042877..f00d67a3 100644 --- a/win32/wsnes9x.cpp +++ b/win32/wsnes9x.cpp @@ -2829,7 +2829,12 @@ VOID CALLBACK HotkeyTimer( UINT idEvent, UINT uMsg, DWORD dwUser, DWORD dw1, DWO if(counter%2 && !joyState[i]) continue; - bool active = !S9xGetState(i); + // special case for escape since S9xGetState ignores it + bool active; + if (i == VK_ESCAPE) + active = (GetKeyState(VK_ESCAPE) & 0x80) != 0; + else + active = !S9xGetState(i); if(active) { if(joyState[i] < ULONG_MAX) // 0xffffffffUL