diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-03-01 23:00:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-01 23:00:42 +0100 |
commit | e2b66cacf78ae39b94df748e9740b98a1f011e77 (patch) | |
tree | 56d468d762c43879c20b342702e8fc999221e6c6 /platform/uwp | |
parent | 55396d6e06f8e4e355e9ab0595bdb7f27c1c36dd (diff) | |
parent | 1af06d3d4608b17c74caed951cd9579ccbba229d (diff) |
Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodes
Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
Diffstat (limited to 'platform/uwp')
-rw-r--r-- | platform/uwp/app.cpp | 6 | ||||
-rw-r--r-- | platform/uwp/os_uwp.cpp | 3 | ||||
-rw-r--r-- | platform/uwp/os_uwp.h | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp index a47fe96c1b..ccb4b43373 100644 --- a/platform/uwp/app.cpp +++ b/platform/uwp/app.cpp @@ -410,14 +410,16 @@ void App::key_event(Windows::UI::Core::CoreWindow ^ sender, bool p_pressed, Wind ke.type = OS_UWP::KeyEvent::MessageType::KEY_EVENT_MESSAGE; ke.unicode = 0; - ke.scancode = KeyMappingWindows::get_keysym((unsigned int)key_args->VirtualKey); + ke.keycode = KeyMappingWindows::get_keysym((unsigned int)key_args->VirtualKey); + ke.physical_keycode = KeyMappingWindows::get_scansym((unsigned int)key_args->KeyStatus.ScanCode); ke.echo = (!p_pressed && !key_args->KeyStatus.IsKeyReleased) || (p_pressed && key_args->KeyStatus.WasKeyDown); } else { ke.type = OS_UWP::KeyEvent::MessageType::CHAR_EVENT_MESSAGE; ke.unicode = char_args->KeyCode; - ke.scancode = 0; + ke.keycode = 0; + ke.physical_keycode = 0; ke.echo = (!p_pressed && !char_args->KeyStatus.IsKeyReleased) || (p_pressed && char_args->KeyStatus.WasKeyDown); } diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 1e63d50263..97c8dafe65 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -605,7 +605,8 @@ void OS_UWP::process_key_events() { key_event->set_shift(kev.shift); key_event->set_control(kev.control); key_event->set_echo(kev.echo); - key_event->set_scancode(kev.scancode); + key_event->set_keycode(kev.keycode); + key_event->set_physical_keycode(kev.physical_keycode); key_event->set_unicode(kev.unicode); key_event->set_pressed(kev.pressed); diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index 32b899c0da..ac6e0f3dd5 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -61,7 +61,8 @@ public: bool alt, shift, control; MessageType type; bool pressed; - unsigned int scancode; + unsigned int keycode; + unsigned int physical_keycode; unsigned int unicode; bool echo; CorePhysicalKeyStatus status; |