diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2018-04-05 20:59:35 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-02-25 12:30:33 +0200 |
commit | 1af06d3d4608b17c74caed951cd9579ccbba229d (patch) | |
tree | a0d57c6cd3c00614a5a30290085e91a6097e78b6 /platform/uwp | |
parent | 376a8255a9b65b016fcd81634bfd54fb7fa029df (diff) |
Rename `scancode` to `keycode`.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
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 3cd7a02a94..4445fdec78 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -606,7 +606,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; |