- Timestamp:
- Jul 15, 2019 7:23:15 AM (6 years ago)
- 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 146 146 UISoftKeyboardKey *lockKey(int iKeyPosition) const; 147 147 void updateLockKeyStates(bool fCapsLockState, bool fNumLockState, bool fScrollLockState); 148 void reset(); 148 149 149 150 private: … … 177 178 void setLayoutToEdit(UISoftKeyboardLayout *pLayout); 178 179 void setPhysicalLayoutList(const QVector<UISoftKeyboardPhysicalLayout> &physicalLayouts); 180 void reset(); 179 181 180 182 protected: … … 197 199 void prepareConnections(); 198 200 QWidget *prepareKeyCaptionEditWidgets(); 199 void reset();200 201 void resetKeyWidgets(); 201 202 QGridLayout *m_pEditorLayout; … … 356 357 void setCutout(int iCorner, int iWidth, int iHeight); 357 358 359 KeyState state() const; 360 void setState(KeyState state); 361 358 362 void setParentWidget(UISoftKeyboardWidget* pParent); 359 KeyState state() const;360 363 QVector<LONG> scanCodeWithPrefix() const; 361 364 … … 373 376 374 377 void updateLockState(bool fLocked); 378 void reset(); 375 379 376 380 private: … … 572 576 * from the guest OS. Parameter fXXXState is true if the corresponding key is locked. */ 573 577 void updateLockKeyStates(bool fCapsLockState, bool fNumLockState, bool fScrollLockState); 578 void reset(); 574 579 575 580 protected: … … 600 605 bool loadPhysicalLayout(const QString &strLayoutFileName, bool isNumPad = false); 601 606 bool loadKeyboardLayout(const QString &strLayoutName); 602 void reset();603 607 void prepareObjects(); 604 608 UISoftKeyboardPhysicalLayout *findPhysicalLayout(const QUuid &uuid); … … 820 824 updateLockKeyState(fNumLockState, m_lockKeys.value(iNumLockPosition, 0)); 821 825 updateLockKeyState(fScrollLockState, m_lockKeys.value(iScrollLockPosition, 0)); 826 } 827 828 void 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 } 822 837 } 823 838 … … 1555 1570 } 1556 1571 1572 void UISoftKeyboardKey::setState(KeyState state) 1573 { 1574 m_enmState = state; 1575 } 1576 1557 1577 void UISoftKeyboardKey::setParentWidget(UISoftKeyboardWidget* pParent) 1558 1578 { … … 1650 1670 return; 1651 1671 updateState(fLocked); 1672 } 1673 1674 void UISoftKeyboardKey::reset() 1675 { 1676 m_enmState = KeyState_NotPressed; 1652 1677 } 1653 1678 … … 2552 2577 if (!pKey || pKey->type() != KeyType_Modifier) 2553 2578 return; 2554 if (pKey->state() != KeyState_NotPressed) 2555 return; 2579 2580 pKey->setState(KeyState_NotPressed); 2581 2556 2582 QVector<QPair<LONG, LONG> > sequence; 2557 2583 sequence << pKey->usagePageIdPair(); 2558 2584 if (fRelease) 2585 emit sigPutUsageCodesRelease(sequence); 2586 else 2559 2587 emit sigPutUsageCodesPress(sequence); 2560 else2561 emit sigPutUsageCodesRelease(sequence);2562 2588 } 2563 2589 … … 2751 2777 { 2752 2778 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(); 2753 2786 } 2754 2787 … … 3465 3498 { 3466 3499 saveSettings(); 3500 keyboard().ReleaseKeys(); 3467 3501 } 3468 3502 … … 3832 3866 } 3833 3867 3868 void UISoftKeyboard::reset() 3869 { 3870 if (m_pKeyboardWidget) 3871 m_pKeyboardWidget->reset(); 3872 if (m_pLayoutEditor) 3873 m_pLayoutEditor->reset(); 3874 keyboard().ReleaseKeys(); 3875 } 3876 3834 3877 #include "UISoftKeyboard.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h
r79779 r79780 101 101 void updateLayoutSelectorList(); 102 102 void setDialogGeometry(const QRect &geometry); 103 void reset(); 103 104 CKeyboard& keyboard() const; 104 105
Note:
See TracChangeset
for help on using the changeset viewer.