HotkeyManager: Activate hotkey when key is pressed.

As opposed to activating the hotkey when it is released.
This commit is contained in:
Jules Blok 2015-07-25 13:53:27 +02:00
parent 75fc213359
commit 3814b5b702
1 changed files with 2 additions and 4 deletions

View File

@ -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;