Changeset 52924 in vbox for trunk/src/VBox/Main/src-client/KeyboardImpl.cpp
- Timestamp:
- Oct 2, 2014 7:47:58 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 96359
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/KeyboardImpl.cpp
r52400 r52924 79 79 mpVMMDev = NULL; 80 80 mfVMMDevInited = false; 81 menmLeds = PDMKEYBLEDS_NONE; 81 82 return BaseFinalConstruct(); 82 83 } … … 141 142 mpVMMDev = NULL; 142 143 mfVMMDevInited = true; 144 145 menmLeds = PDMKEYBLEDS_NONE; 143 146 144 147 unconst(mParent) = NULL; … … 261 264 } 262 265 266 HRESULT Keyboard::getKeyboardLEDs(std::vector<KeyboardLED_T> &aKeyboardLEDs) 267 { 268 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 269 270 aKeyboardLEDs.resize(0); 271 272 if (menmLeds & PDMKEYBLEDS_NUMLOCK) aKeyboardLEDs.push_back(KeyboardLED_NumLock); 273 if (menmLeds & PDMKEYBLEDS_CAPSLOCK) aKeyboardLEDs.push_back(KeyboardLED_CapsLock); 274 if (menmLeds & PDMKEYBLEDS_SCROLLLOCK) aKeyboardLEDs.push_back(KeyboardLED_ScrollLock); 275 276 return S_OK; 277 } 263 278 264 279 HRESULT Keyboard::getEventSource(ComPtr<IEventSource> &aEventSource) … … 273 288 // private methods 274 289 // 290 void Keyboard::onKeyboardLedsChange(PDMKEYBLEDS enmLeds) 291 { 292 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 293 294 /* Save the current status. */ 295 menmLeds = enmLeds; 296 297 alock.release(); 298 299 i_getParent()->i_onKeyboardLedsChange(RT_BOOL(enmLeds & PDMKEYBLEDS_NUMLOCK), 300 RT_BOOL(enmLeds & PDMKEYBLEDS_CAPSLOCK), 301 RT_BOOL(enmLeds & PDMKEYBLEDS_SCROLLLOCK)); 302 } 303 275 304 DECLCALLBACK(void) Keyboard::i_keyboardLedStatusChange(PPDMIKEYBOARDCONNECTOR pInterface, PDMKEYBLEDS enmLeds) 276 305 { 277 306 PDRVMAINKEYBOARD pDrv = RT_FROM_MEMBER(pInterface, DRVMAINKEYBOARD, IConnector); 278 pDrv->pKeyboard->i_getParent()->i_onKeyboardLedsChange(RT_BOOL(enmLeds & PDMKEYBLEDS_NUMLOCK), 279 RT_BOOL(enmLeds & PDMKEYBLEDS_CAPSLOCK), 280 RT_BOOL(enmLeds & PDMKEYBLEDS_SCROLLLOCK)); 307 pDrv->pKeyboard->onKeyboardLedsChange(enmLeds); 281 308 } 282 309
Note:
See TracChangeset
for help on using the changeset viewer.