diff options
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; |