- Timestamp:
- Sep 17, 2013 6:32:07 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r48504 r48510 2182 2182 // session().GetMachine().GetName().toAscii().constData()); 2183 2183 2184 /* Here we have to save current host LED lock states in UISession registry. 2185 * [void] uisession() -> setHostNumLock(), setHostCapsLock(), setHostScrollLock() can be used for that. */ 2184 /* Here we have to store host LED lock states to UISession registry. 2185 * This can be done for each keyboard separately, just keep in mind keyboard IDs. 2186 * [void] uisession() -> setHostLockStates() can be used for that. */ 2186 2187 2187 2188 /* Here we have to update host LED lock states using values provided by UISession registry. … … 2198 2199 2199 2200 /* Here we have to restore host LED lock states from UISession registry. 2200 * [bool] uisession() -> isHostNumLock(), isHostCapsLock(), isHostScrollLock() can be used for that. */ 2201 * This can be done for each keyboard separately, just use the same keyboard IDs. 2202 * [bool] uisession() -> getHostLockStates() can be used for that. */ 2201 2203 } 2202 2204 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r48504 r48510 99 99 , m_fCapsLock(false) 100 100 , m_fScrollLock(false) 101 , m_fHostNumLock(false)102 , m_fHostCapsLock(false)103 , m_fHostScrollLock(false)104 101 , m_uNumLockAdaptionCnt(2) 105 102 , m_uCapsLockAdaptionCnt(2) … … 467 464 } 468 465 466 void UISession::setHostLockStates(const QString &strKeyboardID, bool fNum, bool fCaps, bool fScroll) 467 { 468 /* Acquire modifiable reference, create default value if doesn't exists: */ 469 UIKeyboardLocks &hostLock = m_hostLocks[strKeyboardID]; 470 /* Save passed values: */ 471 hostLock.m_num = fNum; 472 hostLock.m_caps = fCaps; 473 hostLock.m_scroll = fScroll; 474 } 475 476 void UISession::getHostLockStates(const QString &strKeyboardID, bool &fNum, bool &fCaps, bool &fScroll) 477 { 478 /* Acquire modifiable reference, create default value if doesn't exists: */ 479 UIKeyboardLocks &hostLock = m_hostLocks[strKeyboardID]; 480 /* Load cached values: */ 481 fNum = hostLock.m_num; 482 fCaps = hostLock.m_caps; 483 fScroll = hostLock.m_scroll; 484 } 485 469 486 bool UISession::setPause(bool fOn) 470 487 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r48504 r48510 24 24 #include <QCursor> 25 25 #include <QEvent> 26 #include <QMap> 26 27 27 28 /* GUI includes: */ … … 77 78 }; 78 79 80 /* Keyboard Lock container: */ 81 struct UIKeyboardLocks 82 { 83 /* Constructor: */ 84 UIKeyboardLocks() 85 : m_num(false) 86 , m_caps(false) 87 , m_scroll(false) 88 {} 89 /* Variables: */ 90 bool m_num; 91 bool m_caps; 92 bool m_scroll; 93 }; 94 typedef QMap<QString, UIKeyboardLocks> UIKeyboardLocksMap; 95 79 96 class UISession : public QObject 80 97 { … … 134 151 bool isCapsLock() const { return m_fCapsLock; } 135 152 bool isScrollLock() const { return m_fScrollLock; } 136 bool isHostNumLock() const { return m_fHostNumLock; }137 bool isHostCapsLock() const { return m_fHostCapsLock; }138 bool isHostScrollLock() const { return m_fHostScrollLock; }139 void setHostNumLock(bool fHostNumLock) { m_fHostNumLock = fHostNumLock; }140 void setHostCapsLock(bool fHostCapsLock) { m_fHostCapsLock = fHostCapsLock; }141 void setHostScrollLock(bool fHostScrollLock) { m_fHostScrollLock = fHostScrollLock; }142 153 uint numLockAdaptionCnt() const { return m_uNumLockAdaptionCnt; } 143 154 uint capsLockAdaptionCnt() const { return m_uCapsLockAdaptionCnt; } 155 void setHostLockStates(const QString &strKeyboardID, bool fNum, bool fCaps, bool fScroll); 156 void getHostLockStates(const QString &strKeyboardID, bool &fNum, bool &fCaps, bool &fScroll); 144 157 145 158 /* Mouse getters: */ … … 306 319 bool m_fCapsLock : 1; 307 320 bool m_fScrollLock : 1; 308 bool m_fHostNumLock : 1;309 bool m_fHostCapsLock : 1;310 bool m_fHostScrollLock : 1;311 321 uint m_uNumLockAdaptionCnt; 312 322 uint m_uCapsLockAdaptionCnt; 323 UIKeyboardLocksMap m_hostLocks; 313 324 314 325 /* Mouse flags: */
Note:
See TracChangeset
for help on using the changeset viewer.