Skip to content

Commit

Permalink
Fix simulating several keys on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
TolikPylypchuk authored and kwhat committed May 7, 2024
1 parent 02c258a commit 2a2d40f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/windows/post_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2a2d40f

Please sign in to comment.