Changeset 49090 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 14, 2013 6:33:39 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp
r49049 r49090 311 311 IOHIDDeviceRef pDevice; /** A reference to IOKit HID device */ 312 312 VBoxLedState_t LED; /** LED states */ 313 CFMutableArrayRef pStorageArray; /** A reference to arraywhere VBoxKbdState_t instance is stored */313 void *pParentContainer; /** A pointer to a VBoxHidsState_t instance where VBoxKbdState_t instance is stored */ 314 314 CFIndex idxPosition; /** Position in global storage (used to simplify CFArray navigation when removing detached device) */ 315 315 } VBoxKbdState_t; … … 1476 1476 { 1477 1477 Log2(("carbon event: caps=%s, num=%s\n", VBOX_BOOL_TO_STR_STATE(fCaps), VBOX_BOOL_TO_STR_STATE(fNum))); 1478 if (g_LastTouchedState) 1479 { 1480 g_LastTouchedState->LED.fCapsLockOn = fCaps; 1481 g_LastTouchedState->LED.fNumLockOn = fNum; 1478 1479 VBoxKbdState_t *pKbd = g_LastTouchedState; 1480 if (pKbd) 1481 { 1482 pKbd->LED.fCapsLockOn = fCaps; 1483 pKbd->LED.fNumLockOn = fNum; 1484 1485 /* Silently resync last touched KBD device */ 1486 VBoxHidsState_t *pHidState = (VBoxHidsState_t *)pKbd->pParentContainer; 1487 if (pHidState) 1488 { 1489 CFDictionaryRef elementMatchingDict = darwinQueryLedElementMatchingDictionary(); 1490 if (elementMatchingDict) 1491 { 1492 (void)darwinSetDeviceLedsState(pKbd->pDevice, elementMatchingDict, pHidState->guestState.fNumLockOn, 1493 pHidState->guestState.fCapsLockOn, pHidState->guestState.fScrollLockOn); 1494 1495 CFRelease(elementMatchingDict); 1496 } 1497 } 1482 1498 1483 1499 /* Forget device */ … … 1495 1511 (void)unused1; 1496 1512 1497 VBoxKbdState_t *pKbd = (VBoxKbdState_t *)pData;1498 1499 AssertReturnVoid(pKbd); 1500 AssertReturnVoid(p Kbd->pStorageArray);1513 VBoxKbdState_t *pKbd = (VBoxKbdState_t *)pData; AssertReturnVoid(pKbd); 1514 VBoxHidsState_t *pHidState = (VBoxHidsState_t *)pKbd->pParentContainer; AssertReturnVoid(pHidState); 1515 1516 AssertReturnVoid(pHidState->pDeviceCollection); 1501 1517 1502 1518 Log2(("Forget KBD %d\n", (int)pKbd->idxPosition)); 1503 CFArrayRemoveValueAtIndex(p Kbd->pStorageArray, pKbd->idxPosition);1519 CFArrayRemoveValueAtIndex(pHidState->pDeviceCollection, pKbd->idxPosition); 1504 1520 free(pKbd); 1505 1521 } … … 1535 1551 { 1536 1552 pKbd->pDevice = pDevice; 1537 pKbd->p StorageArray = pHidState->pDeviceCollection;1553 pKbd->pParentContainer = (void *)pHidState; 1538 1554 pKbd->idxPosition = CFArrayGetCount(pHidState->pDeviceCollection); 1539 1555
Note:
See TracChangeset
for help on using the changeset viewer.