From 2a2d40f96178481d98980da0a8c1db8a41937d7c Mon Sep 17 00:00:00 2001 From: Tolik Pylypchuk Date: Mon, 6 May 2024 12:21:13 +0300 Subject: [PATCH] Fix simulating several keys on Windows --- src/windows/post_event.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/windows/post_event.c b/src/windows/post_event.c index 4da47b00..b2e6b45f 100644 --- a/src/windows/post_event.c +++ b/src/windows/post_event.c @@ -86,6 +86,22 @@ static int map_keyboard_event(uiohook_event * const event, INPUT * const input) if (HIBYTE(input->ki.wScan)) { input->ki.dwFlags |= KEYEVENTF_EXTENDEDKEY; + } else { + switch (event->data.keyboard.keycode) { + case VC_UP: + case VC_DOWN: + case VC_LEFT: + case VC_RIGHT: + case VC_HOME: + case VC_END: + case VC_PAGE_UP: + case VC_PAGE_DOWN: + case VC_INSERT: + case VC_DELETE: + case VC_KP_ENTER: + input->ki.dwFlags |= KEYEVENTF_EXTENDEDKEY; + break; + } } return UIOHOOK_SUCCESS;