VirtualBox

Changeset 79780 in vbox for trunk


Ignore:
Timestamp:
Jul 15, 2019 7:23:15 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6143. Mess up release press order in r132145

Location:
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp

    r79779 r79780  
    146146    UISoftKeyboardKey *lockKey(int iKeyPosition) const;
    147147    void updateLockKeyStates(bool fCapsLockState, bool fNumLockState, bool fScrollLockState);
     148    void reset();
    148149
    149150private:
     
    177178    void setLayoutToEdit(UISoftKeyboardLayout *pLayout);
    178179    void setPhysicalLayoutList(const QVector<UISoftKeyboardPhysicalLayout> &physicalLayouts);
     180    void reset();
    179181
    180182protected:
     
    197199    void prepareConnections();
    198200    QWidget *prepareKeyCaptionEditWidgets();
    199     void reset();
    200201    void resetKeyWidgets();
    201202    QGridLayout *m_pEditorLayout;
     
    356357    void setCutout(int iCorner, int iWidth, int iHeight);
    357358
     359    KeyState state() const;
     360    void setState(KeyState state);
     361
    358362    void setParentWidget(UISoftKeyboardWidget* pParent);
    359     KeyState state() const;
    360363    QVector<LONG> scanCodeWithPrefix() const;
    361364
     
    373376
    374377    void updateLockState(bool fLocked);
     378    void reset();
    375379
    376380private:
     
    572576      * from the guest OS. Parameter fXXXState is true if the corresponding key is locked. */
    573577    void updateLockKeyStates(bool fCapsLockState, bool fNumLockState, bool fScrollLockState);
     578    void reset();
    574579
    575580protected:
     
    600605    bool               loadPhysicalLayout(const QString &strLayoutFileName, bool isNumPad = false);
    601606    bool               loadKeyboardLayout(const QString &strLayoutName);
    602     void               reset();
    603607    void               prepareObjects();
    604608    UISoftKeyboardPhysicalLayout *findPhysicalLayout(const QUuid &uuid);
     
    820824    updateLockKeyState(fNumLockState, m_lockKeys.value(iNumLockPosition, 0));
    821825    updateLockKeyState(fScrollLockState, m_lockKeys.value(iScrollLockPosition, 0));
     826}
     827
     828void UISoftKeyboardPhysicalLayout::reset()
     829{
     830    for (int i = 0; i < m_rows.size(); ++i)
     831    {
     832        for (int j = 0; j < m_rows[i].keys().size(); ++j)
     833        {
     834            m_rows[i].keys()[j].reset();
     835        }
     836    }
    822837}
    823838
     
    15551570}
    15561571
     1572void UISoftKeyboardKey::setState(KeyState state)
     1573{
     1574    m_enmState = state;
     1575}
     1576
    15571577void UISoftKeyboardKey::setParentWidget(UISoftKeyboardWidget* pParent)
    15581578{
     
    16501670        return;
    16511671    updateState(fLocked);
     1672}
     1673
     1674void UISoftKeyboardKey::reset()
     1675{
     1676    m_enmState = KeyState_NotPressed;
    16521677}
    16531678
     
    25522577    if (!pKey || pKey->type() != KeyType_Modifier)
    25532578        return;
    2554     if (pKey->state() != KeyState_NotPressed)
    2555         return;
     2579
     2580    pKey->setState(KeyState_NotPressed);
     2581
    25562582    QVector<QPair<LONG, LONG> > sequence;
    25572583    sequence << pKey->usagePageIdPair();
    25582584    if (fRelease)
     2585        emit sigPutUsageCodesRelease(sequence);
     2586    else
    25592587        emit sigPutUsageCodesPress(sequence);
    2560     else
    2561         emit sigPutUsageCodesRelease(sequence);
    25622588}
    25632589
     
    27512777{
    27522778    m_pressedModifiers.clear();
     2779    m_pKeyUnderMouse = 0;
     2780    m_pKeyBeingEdited = 0;
     2781    m_pKeyPressed = 0;
     2782    m_enmMode = Mode_Keyboard;
     2783
     2784    for (int i = 0; i < m_physicalLayouts.size(); ++i)
     2785        m_physicalLayouts[i].reset();
    27532786}
    27542787
     
    34653498{
    34663499    saveSettings();
     3500    keyboard().ReleaseKeys();
    34673501}
    34683502
     
    38323866}
    38333867
     3868void UISoftKeyboard::reset()
     3869{
     3870    if (m_pKeyboardWidget)
     3871        m_pKeyboardWidget->reset();
     3872    if (m_pLayoutEditor)
     3873        m_pLayoutEditor->reset();
     3874    keyboard().ReleaseKeys();
     3875}
     3876
    38343877#include "UISoftKeyboard.moc"
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h

    r79779 r79780  
    101101    void updateLayoutSelectorList();
    102102    void setDialogGeometry(const QRect &geometry);
     103    void reset();
    103104    CKeyboard& keyboard() const;
    104105
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