diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/osd/modules/input/input_uwp.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/osd/modules/input/input_uwp.cpp b/src/osd/modules/input/input_uwp.cpp index ece01a41662..2130d000fea 100644 --- a/src/osd/modules/input/input_uwp.cpp +++ b/src/osd/modules/input/input_uwp.cpp @@ -221,6 +221,7 @@ internal: keyboard({{0}}), m_coreWindow(coreWindow) { + coreWindow->Dispatcher->AcceleratorKeyActivated += ref new TypedEventHandler<CoreDispatcher^, AcceleratorKeyEventArgs^>(this, &UwpKeyboardDevice::OnAcceleratorKeyActivated); coreWindow->KeyDown += ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &UwpKeyboardDevice::OnKeyDown); coreWindow->KeyUp += ref new TypedEventHandler<CoreWindow^, KeyEventArgs^>(this, &UwpKeyboardDevice::OnKeyUp); coreWindow->CharacterReceived += ref new TypedEventHandler<CoreWindow^, CharacterReceivedEventArgs^>(this, &UwpKeyboardDevice::OnCharacterReceived); @@ -274,6 +275,20 @@ internal: { this->Machine.ui_input().push_char_event(osd_common_t::s_window_list.front()->target(), args->KeyCode); } + + void OnAcceleratorKeyActivated(CoreDispatcher ^sender, AcceleratorKeyEventArgs ^args) + { + std::lock_guard<std::mutex> scope_lock(m_state_lock); + auto eventType = args->EventType; + if (eventType == CoreAcceleratorKeyEventType::SystemKeyDown || + eventType == CoreAcceleratorKeyEventType::SystemKeyUp) + { + CorePhysicalKeyStatus status = args->KeyStatus; + int discancode = (status.ScanCode & 0x7f) | (status.IsExtendedKey ? 0x80 : 0x00); + keyboard.state[discancode] = + eventType == CoreAcceleratorKeyEventType::SystemKeyDown ? 0x80 : 0; + } + } }; //============================================================ @@ -632,4 +647,3 @@ MODULE_NOT_SUPPORTED(uwp_joystick_module, OSD_JOYSTICKINPUT_PROVIDER, "uwp") MODULE_DEFINITION(KEYBOARDINPUT_UWP, uwp_keyboard_module) MODULE_DEFINITION(JOYSTICKINPUT_UWP, uwp_joystick_module) - |