Merge pull request #12846 from sonninnos/sdl2-keycodes

(WINSDL2) Fix keyboard event keycodes
This commit is contained in:
Autechre 2021-08-22 01:01:40 +02:00 committed by GitHub
commit 5f3cb1fae2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -979,8 +979,14 @@ static LRESULT CALLBACK wnd_proc_common_internal(HWND hwnd,
quit = true;
{
uint16_t mod = 0;
unsigned keysym = (unsigned)wparam;
unsigned keycode = input_keymaps_translate_keysym_to_rk(keysym);
unsigned keycode = 0;
unsigned keysym = (lparam >> 16) & 0xff;
/* extended keys will map to dinput if the high bit is set */
if ((lparam >> 24 & 0x1))
keysym |= 0x80;
keycode = input_keymaps_translate_keysym_to_rk(keysym);
if (GetKeyState(VK_SHIFT) & 0x80)
mod |= RETROKMOD_SHIFT;