Changeset 106611 in vbox
- Timestamp:
- Oct 23, 2024 7:50:23 AM (5 weeks ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r106349 r106611 2009 2009 emit sigStateChange(state()); 2010 2010 } 2011 2012 #ifdef VBOX_WS_NIX 2013 void UIKeyboardHandler::handleKeyEvent(quint32 nativeScanCode, bool fRelease) 2014 { 2015 if (NativeWindowSubsystem::displayServerType() == VBGHDISPLAYSERVERTYPE_PURE_WAYLAND) 2016 { 2017 /* On Linux xcb, wayland etc has an offset of 8 in scancodes (they start from 7 instead of 0): */ 2018 if (!fRelease) 2019 uimachine()->putScancode(nativeScanCode - 8); 2020 else 2021 uimachine()->putScancode((nativeScanCode - 8) | 0x80); 2022 } 2023 } 2024 #endif -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.h
r106061 r106611 120 120 * @a bPressed is true for press and false for release inserts. */ 121 121 void setHostKeyComboPressedFlag(bool bPressed); 122 123 #ifdef VBOX_WS_NIX 124 void handleKeyEvent(quint32 nativeScanCode, bool fRelease); 125 #endif 122 126 123 127 protected slots: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r106349 r106611 2021 2021 void UIMachineView::keyPressEvent(QKeyEvent *pEvent) 2022 2022 { 2023 if (NativeWindowSubsystem::displayServerType() == VBGHDISPLAYSERVERTYPE_PURE_WAYLAND) 2024 uimachine()->putScancode(pEvent->nativeScanCode() - 8); 2023 machineLogic()->keyboardHandler()->handleKeyEvent(pEvent->nativeScanCode(), false /* is release*/); 2025 2024 QAbstractScrollArea::keyPressEvent(pEvent); 2026 2025 } … … 2028 2027 void UIMachineView::keyReleaseEvent(QKeyEvent *pEvent) 2029 2028 { 2030 if (NativeWindowSubsystem::displayServerType() == VBGHDISPLAYSERVERTYPE_PURE_WAYLAND) 2031 uimachine()->putScancode((pEvent->nativeScanCode() - 8) | 0x80); 2029 machineLogic()->keyboardHandler()->handleKeyEvent(pEvent->nativeScanCode(), true /* is release*/); 2032 2030 QAbstractScrollArea::keyReleaseEvent(pEvent); 2033 2031 }
Note:
See TracChangeset
for help on using the changeset viewer.