From 1f39b6a6122e7a8036e195bd27cc2a597cd8b3fd Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Wed, 20 Apr 2016 03:43:05 +0200 Subject: [PATCH] libobs: Don't use was_down for hotkey detection From MSDN: "The behavior of the least significant bit of the return value is retained strictly for compatibility with 16-bit Windows applications (which are non-preemptive) and should not be relied upon." This caused problems with hotkeys firing if the user pressed a hotkey key in another application, followed by the modifier keys at any other time. OBS would then think the hotkey key was just pressed based on the was_down behavior and incorrectly trigger a hotkey event. Fixes 0000443. --- libobs/obs-windows.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libobs/obs-windows.c b/libobs/obs-windows.c index f578e6d6c..e282a2792 100644 --- a/libobs/obs-windows.c +++ b/libobs/obs-windows.c @@ -384,8 +384,8 @@ static bool vk_down(DWORD vk) { short state = GetAsyncKeyState(vk); bool down = (state & 0x8000) != 0; - bool was_down = (state & 0x1) != 0; - return down || was_down; + + return down; } bool obs_hotkeys_platform_is_pressed(obs_hotkeys_platform_t *context,