Changeset 52924 in vbox for trunk/src/VBox
- Timestamp:
- Oct 2, 2014 7:47:58 AM (10 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r52921 r52924 14923 14923 --> 14924 14924 14925 <enum 14926 name="KeyboardLED" 14927 uuid="ef29ea38-409b-49c7-a817-c858d426dfba" 14928 > 14929 <desc> 14930 Keyboard LED indicators. 14931 </desc> 14932 14933 <const name="NumLock" value="0x01"/> 14934 <const name="CapsLock" value="0x02"/> 14935 <const name="ScrollLock" value="0x04"/> 14936 </enum> 14937 14925 14938 <interface 14926 14939 name="IKeyboard" extends="$unknown" 14927 uuid=" 71aa2898-28bd-43fe-8c98-e53321451db7"14940 uuid="585cc5e8-349c-41c6-899d-d9a38e3f4126" 14928 14941 wsmap="managed" 14929 14942 > … … 14935 14948 to the virtual machine. 14936 14949 </desc> 14950 14951 <attribute name="keyboardLEDs" type="KeyboardLED" safearray="yes" readonly="yes"> 14952 <desc> 14953 Current status of the guest keyboard LEDs. 14954 </desc> 14955 </attribute> 14937 14956 14938 14957 <method name="putScancode"> -
trunk/src/VBox/Main/include/KeyboardImpl.h
r52858 r52924 66 66 // Wrapped Keyboard properties 67 67 HRESULT getEventSource(ComPtr<IEventSource> &aEventSource); 68 HRESULT getKeyboardLEDs(std::vector<KeyboardLED_T> &aKeyboardLEDs); 69 70 // Wrapped Keyboard members 68 71 HRESULT putScancode(LONG aScancode); 69 72 HRESULT putScancodes(const std::vector<LONG> &aScancodes, 70 73 ULONG *aCodesStored); 71 72 // Wrapped Keyboard members73 74 HRESULT putCAD(); 74 75 HRESULT releaseKeys(); … … 80 81 static DECLCALLBACK(void) i_drvDestruct(PPDMDRVINS pDrvIns); 81 82 83 void onKeyboardLedsChange(PDMKEYBLEDS enmLeds); 84 82 85 Console * const mParent; 83 86 /** Pointer to the associated keyboard driver(s). */ … … 88 91 bool mfVMMDevInited; 89 92 93 /* The current guest keyboard LED status. */ 94 PDMKEYBLEDS menmLeds; 95 90 96 const ComObjPtr<EventSource> mEventSource; 91 97 }; -
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.