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
This commit is contained in:
Doug Brown 2022-01-16 17:23:24 -08:00
parent f1502fb6bd
commit 44f6eff928
2 changed files with 2 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}