From 3814b5b7024e03fbb2a9be2784842b586d96d17a Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Sat, 25 Jul 2015 13:53:27 +0200 Subject: [PATCH] HotkeyManager: Activate hotkey when key is pressed. As opposed to activating the hotkey when it is released. --- Source/Core/Core/HotkeyManager.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/HotkeyManager.cpp b/Source/Core/Core/HotkeyManager.cpp index 64ffb097f7..2e53ad1ac0 100644 --- a/Source/Core/Core/HotkeyManager.cpp +++ b/Source/Core/Core/HotkeyManager.cpp @@ -159,16 +159,14 @@ bool IsPressed(int Id, bool held) unsigned int setKey = Id % 32; if (s_hotkey.button[set] & (1 << setKey)) { + bool pressed = !!(s_hotkeyDown[set] & (1 << setKey)); s_hotkeyDown[set] |= (1 << setKey); - if (held) + if (!pressed || held) return true; } else { - bool pressed = !!(s_hotkeyDown[set] & (1 << setKey)); s_hotkeyDown[set] &= ~(1 << setKey); - if (pressed) - return true; } return false;