From 44f6eff92817e000a556251c30599462535e5880 Mon Sep 17 00:00:00 2001 From: Doug Brown Date: Sun, 16 Jan 2022 17:23:24 -0800 Subject: [PATCH] Include scancode when reservewindowskey is enabled Previously, only the keycode was being filled in. This worked in many cases, but it turns out that the scancode is also important in order to be compatible with some keycode mapping files. See discussion: https://www.emaculation.com/forum/viewtopic.php?p=72685 --- BasiliskII/src/Windows/main_windows.cpp | 1 + SheepShaver/src/Windows/main_windows.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/BasiliskII/src/Windows/main_windows.cpp b/BasiliskII/src/Windows/main_windows.cpp index 77e2db5d..148aba6d 100755 --- a/BasiliskII/src/Windows/main_windows.cpp +++ b/BasiliskII/src/Windows/main_windows.cpp @@ -749,6 +749,7 @@ static LRESULT CALLBACK low_level_keyboard_hook(int nCode, WPARAM wParam, LPARAM memset(&e, 0, sizeof(e)); e.type = (wParam == WM_KEYDOWN) ? SDL_KEYDOWN : SDL_KEYUP; e.key.keysym.sym = (p->vkCode == VK_LWIN) ? SDLK_LGUI : SDLK_RGUI; + e.key.keysym.scancode = (p->vkCode == VK_LWIN) ? SDL_SCANCODE_LGUI : SDL_SCANCODE_RGUI; SDL_PushEvent(&e); return 1; } diff --git a/SheepShaver/src/Windows/main_windows.cpp b/SheepShaver/src/Windows/main_windows.cpp index 0ee65b12..6a556384 100755 --- a/SheepShaver/src/Windows/main_windows.cpp +++ b/SheepShaver/src/Windows/main_windows.cpp @@ -877,6 +877,7 @@ static LRESULT CALLBACK low_level_keyboard_hook(int nCode, WPARAM wParam, LPARAM memset(&e, 0, sizeof(e)); e.type = (wParam == WM_KEYDOWN) ? SDL_KEYDOWN : SDL_KEYUP; e.key.keysym.sym = (p->vkCode == VK_LWIN) ? SDLK_LGUI : SDLK_RGUI; + e.key.keysym.scancode = (p->vkCode == VK_LWIN) ? SDL_SCANCODE_LGUI : SDL_SCANCODE_RGUI; SDL_PushEvent(&e); return 1; }