VirtualBox

Changeset 106611 in vbox


Ignore:
Timestamp:
Oct 23, 2024 7:50:23 AM (5 weeks ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10407. Handle machine view key press event in keyboard handler.

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  
    20092009    emit sigStateChange(state());
    20102010}
     2011
     2012#ifdef VBOX_WS_NIX
     2013void 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  
    120120      * @a bPressed is true for press and false for release inserts. */
    121121    void setHostKeyComboPressedFlag(bool bPressed);
     122
     123#ifdef VBOX_WS_NIX
     124    void handleKeyEvent(quint32 nativeScanCode, bool fRelease);
     125#endif
    122126
    123127protected slots:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r106349 r106611  
    20212021void UIMachineView::keyPressEvent(QKeyEvent *pEvent)
    20222022{
    2023     if (NativeWindowSubsystem::displayServerType() == VBGHDISPLAYSERVERTYPE_PURE_WAYLAND)
    2024         uimachine()->putScancode(pEvent->nativeScanCode() - 8);
     2023    machineLogic()->keyboardHandler()->handleKeyEvent(pEvent->nativeScanCode(), false /* is release*/);
    20252024    QAbstractScrollArea::keyPressEvent(pEvent);
    20262025}
     
    20282027void UIMachineView::keyReleaseEvent(QKeyEvent *pEvent)
    20292028{
    2030     if (NativeWindowSubsystem::displayServerType() == VBGHDISPLAYSERVERTYPE_PURE_WAYLAND)
    2031         uimachine()->putScancode((pEvent->nativeScanCode() - 8) | 0x80);
     2029    machineLogic()->keyboardHandler()->handleKeyEvent(pEvent->nativeScanCode(), true /* is release*/);
    20322030    QAbstractScrollArea::keyReleaseEvent(pEvent);
    20332031}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette