Added dummy key event to prevent Start Menu from popping up (#4874)

This commit is contained in:
Arjun Balgovind 2020-07-09 08:14:47 -07:00 committed by GitHub
parent d55cac80bf
commit 451aea87aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,13 @@ void HotkeyManager::KeyboardEventProc(KeyboardEvent ^ ev)
if (hotkeys->ContainsKey(pressedKeysHandle))
{
hotkeys[pressedKeysHandle]->Invoke();
// After invoking the hotkey send a dummy key to prevent Start Menu from activating
INPUT dummyEvent[1] = {};
dummyEvent[0].type = INPUT_KEYBOARD;
dummyEvent[0].ki.wVk = 0xFF;
dummyEvent[0].ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, dummyEvent, sizeof(INPUT));
}
}