Skip to content

Commit

Permalink
actual fix to align codes with uiohook header
Browse files Browse the repository at this point in the history
  • Loading branch information
SnosMe committed Mar 29, 2024
1 parent 2e01ba2 commit 7fe4825
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export enum WheelDirection {
export const UiohookKey = {
Backspace: 0x000E,
Tab: 0x000F,
Enter: 0x0E1C,
Enter: 0x001C,
CapsLock: 0x003A,
Escape: 0x0001,
Space: 0x0039,
Expand Down Expand Up @@ -138,7 +138,7 @@ export const UiohookKey = {
NumpadSubtract: 0x004A,
NumpadDecimal: 0x0053,
NumpadDivide: 0x0E35,
NumpadEnter: 0x001C,
NumpadEnter: 0x0E00 | 0x001C,
NumpadEnd: 0xEE00 | 0x004F,
NumpadArrowDown: 0xEE00 | 0x0050,
NumpadPageDown: 0xEE00 | 0x0051,
Expand Down
22 changes: 21 additions & 1 deletion src/libuiohook.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/windows/input_helper.c b/src/windows/input_helper.c
index e690021..4b7cff1 100644
index e690021..0d383e0 100644
--- a/src/windows/input_helper.c
+++ b/src/windows/input_helper.c
@@ -298,7 +298,7 @@ unsigned short keycode_to_scancode(DWORD vk_code, DWORD flags) {
Expand All @@ -11,6 +11,26 @@ index e690021..4b7cff1 100644
logger(LOG_LEVEL_DEBUG, "%s [%u]: Using extended lookup for vk_code: %li\n",
__FUNCTION__, __LINE__, vk_code);

@@ -316,14 +316,16 @@ unsigned short keycode_to_scancode(DWORD vk_code, DWORD flags) {
case VK_DELETE:
scancode |= 0xEE00;
break;
+ }
+ } else {
+ logger(LOG_LEVEL_DEBUG, "%s [%u]: Using normal lookup for vk_code: %li\n",
+ __FUNCTION__, __LINE__, vk_code);

+ switch (vk_code) {
case VK_RETURN:
scancode |= 0x0E00;
break;
}
- } else {
- logger(LOG_LEVEL_DEBUG, "%s [%u]: Using normal lookup for vk_code: %li\n",
- __FUNCTION__, __LINE__, vk_code);
}
}

diff --git a/src/windows/input_hook.c b/src/windows/input_hook.c
index db1e79e..264a71b 100644
--- a/src/windows/input_hook.c
Expand Down

0 comments on commit 7fe4825

Please sign in to comment.