mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Changed dummy key event to send key down and key up to improve compatibility with applications (#7166)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "../../common/common.h"
|
||||
#include "keyboardmanager/dll/Generated Files/resource.h"
|
||||
#include "../common/keyboard_layout.h"
|
||||
#include "KeyboardManagerConstants.h"
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
using namespace winrt::Windows::Foundation;
|
||||
@@ -193,6 +194,15 @@ namespace KeyboardManagerHelper
|
||||
keyEventArray[index].ki.dwExtraInfo = extraInfo;
|
||||
}
|
||||
|
||||
// Function to set the dummy key events used for remapping shortcuts, required to ensure releasing a modifier doesn't trigger another action (For example, Win->Start Menu or Alt->Menu bar)
|
||||
void SetDummyKeyEvent(LPINPUT keyEventArray, int& index, ULONG_PTR extraInfo)
|
||||
{
|
||||
SetKeyEvent(keyEventArray, index, INPUT_KEYBOARD, (WORD)KeyboardManagerConstants::DUMMY_KEY, 0, extraInfo);
|
||||
index++;
|
||||
SetKeyEvent(keyEventArray, index, INPUT_KEYBOARD, (WORD)KeyboardManagerConstants::DUMMY_KEY, KEYEVENTF_KEYUP, extraInfo);
|
||||
index++;
|
||||
}
|
||||
|
||||
// Function to return window handle for a full screen UWP app
|
||||
HWND GetFullscreenUWPWindowHandle()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user