Changeset 49301 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 28, 2013 7:06:40 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 90254
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp
r49290 r49301 1267 1267 rc = IOHIDDeviceSetValue(hidDevice, element, valueRef); 1268 1268 if (rc != kIOReturnSuccess) 1269 Log 2(("Warning! Something went wrong in attempt to turn %s HID device led (error %d)!\n", ((fEnabled) ? "on" : "off"), rc));1269 LogRel(("Warning! Something went wrong in attempt to turn %s HID device led (error %d)!\n", ((fEnabled) ? "on" : "off"), rc)); 1270 1270 else 1271 Log 2(("Led (%d) is turned %s\n", (int)IOHIDElementGetUsage(element), ((fEnabled) ? "on" : "off")));1271 LogRel(("Led (%d) is turned %s\n", (int)IOHIDElementGetUsage(element), ((fEnabled) ? "on" : "off"))); 1272 1272 1273 1273 CFRelease(valueRef); … … 1341 1341 if (rc != 0) 1342 1342 { 1343 Log 2(("Failed to set led (%d) state\n", (int)IOHIDElementGetUsage(element)));1343 LogRel(("Failed to set led (%d) state\n", (int)IOHIDElementGetUsage(element))); 1344 1344 rc2 = kIOReturnError; 1345 1345 } … … 1387 1387 if (rc != 0) 1388 1388 { 1389 Log 2(("Failed to get led (%d) state\n", (int)IOHIDElementGetUsage(element)));1389 LogRel(("Failed to get led (%d) state\n", (int)IOHIDElementGetUsage(element))); 1390 1390 rc2 = kIOReturnError; 1391 1391 } … … 1436 1436 } 1437 1437 1438 Log 2(("HID device Vendor ID 0x%X %s in the list of supported devices.\n", vendorId, (fSupported ? "is" : "is not")));1438 LogRel(("HID device Vendor ID 0x%X %s in the list of supported devices.\n", vendorId, (fSupported ? "is" : "is not"))); 1439 1439 1440 1440 return fSupported; … … 1512 1512 if (fKeyDown) 1513 1513 { 1514 Log 2(("IOHID: KBD %d: Modifier Key-Down\n", (int)pKbd->idxPosition));1514 LogRel(("IOHID: KBD %d: Modifier Key-Down\n", (int)pKbd->idxPosition)); 1515 1515 1516 1516 pEvent->pKbd = pKbd; … … 1528 1528 free(pEvent); 1529 1529 CFArrayRemoveValueAtIndex(pHidState->pFifoEventQueue, iQueue); 1530 Log 2(("IOHID: KBD %d: Modifier Key-Up (Key-Down %llu ms ago). Apple keyboard, removed from queue\n", (int)pKbd->idxPosition, tsDiff));1530 LogRel(("IOHID: KBD %d: Modifier Key-Up (Key-Down %llu ms ago). Apple keyboard, removed from queue\n", (int)pKbd->idxPosition, tsDiff)); 1531 1531 } 1532 1532 else 1533 Log 2(("IOHID: KBD %d: Modifier Key-Up (Key-Down %llu ms ago)\n", (int)pKbd->idxPosition, tsDiff));1533 LogRel(("IOHID: KBD %d: Modifier Key-Up (Key-Down %llu ms ago)\n", (int)pKbd->idxPosition, tsDiff)); 1534 1534 } 1535 1535 } … … 1537 1537 { 1538 1538 if (fKeyDown) 1539 Log 2(("IOHID: unable to find memory to queue KBD %d event\n", (int)pKbd->idxPosition));1539 LogRel(("IOHID: unable to find memory to queue KBD %d event\n", (int)pKbd->idxPosition)); 1540 1540 else 1541 Log 2(("IOHID: unable to find KBD %d event in queue\n", (int)pKbd->idxPosition));1541 LogRel(("IOHID: unable to find KBD %d event in queue\n", (int)pKbd->idxPosition)); 1542 1542 } 1543 1543 … … 1545 1545 } 1546 1546 else 1547 Log 2(("IOHID: No KBD: A modifier key has been pressed\n"));1547 LogRel(("IOHID: No KBD: A modifier key has been pressed\n")); 1548 1548 } 1549 1549 } … … 1586 1586 /* Found one. Keep its index in queue in order to remove it later. */ 1587 1587 iEvent = i; 1588 Log 2(("CARBON: Found event in queue: %d (KBD %d, tsKeyDown=%llu, pressed %llu ms ago)\n", (int)i, (int)pEvent->pKbd->idxPosition, pEvent->tsKeyDown, RTTimeSystemMilliTS() - pEvent->tsKeyDown));1588 LogRel(("CARBON: Found event in queue: %d (KBD %d, tsKeyDown=%llu, pressed %llu ms ago)\n", (int)i, (int)pEvent->pKbd->idxPosition, pEvent->tsKeyDown, RTTimeSystemMilliTS() - pEvent->tsKeyDown)); 1589 1589 break; 1590 1590 } 1591 1591 else 1592 Log 2(("CARBON: skip CAPS LOCK event %d (KBD %d) (tsKeyDown=%llu, pressed %llu ms ago)\n", (int)i, (int)pEvent->pKbd->idxPosition, pEvent->tsKeyDown, RTTimeSystemMilliTS() - pEvent->tsKeyDown));1592 LogRel(("CARBON: skip CAPS LOCK event %d (KBD %d) (tsKeyDown=%llu, pressed %llu ms ago)\n", (int)i, (int)pEvent->pKbd->idxPosition, pEvent->tsKeyDown, RTTimeSystemMilliTS() - pEvent->tsKeyDown)); 1593 1593 1594 1594 pEvent = NULL; … … 1599 1599 VBoxKbdState_t *pKbd = pEvent->pKbd; 1600 1600 1601 Log 2(("CARBON: KBD %d: caps=%s, num=%s. tsKeyDown=%llu, tsKeyUp=%llu [tsDiff=%llu ms]. %d events in queue.\n",1601 LogRel(("CARBON: KBD %d: caps=%s, num=%s. tsKeyDown=%llu, tsKeyUp=%llu [tsDiff=%llu ms]. %d events in queue.\n", 1602 1602 (int)pKbd->idxPosition, VBOX_BOOL_TO_STR_STATE(fCaps), VBOX_BOOL_TO_STR_STATE(fNum), 1603 1603 pEvent->tsKeyDown, pEvent->tsKeyUp, pEvent->tsKeyUp - pEvent->tsKeyDown, … … 1625 1625 } 1626 1626 else 1627 Log 2(("CARBON: No KBD to take care when modifier key has been pressed: caps=%s, num=%s\n", VBOX_BOOL_TO_STR_STATE(fCaps), VBOX_BOOL_TO_STR_STATE(fNum)));1627 LogRel(("CARBON: No KBD to take care when modifier key has been pressed: caps=%s, num=%s\n", VBOX_BOOL_TO_STR_STATE(fCaps), VBOX_BOOL_TO_STR_STATE(fNum))); 1628 1628 } 1629 1629 … … 1644 1644 AssertReturnVoid(pHidState->pDeviceCollection); 1645 1645 1646 Log 2(("Forget KBD %d\n", (int)pKbd->idxPosition));1646 LogRel(("Forget KBD %d\n", (int)pKbd->idxPosition)); 1647 1647 1648 1648 //if (RT_FAILURE(RTSemMutexRequest(pHidState->fifoEventQueueLock, RT_INDEFINITE_WAIT))) … … 1706 1706 if (rc != 0) 1707 1707 { 1708 Log 2(("Unable to get leds state for device %d. Mark leds as turned off\n", (int)(pKbd->idxPosition)));1708 LogRel(("Unable to get leds state for device %d. Mark leds as turned off\n", (int)(pKbd->idxPosition))); 1709 1709 pKbd->LED.fNumLockOn = 1710 1710 pKbd->LED.fCapsLockOn = … … 1721 1721 CFArrayAppendValue(pHidState->pDeviceCollection, (void *)pKbd); 1722 1722 1723 Log 2(("Saved LEDs for KBD %d (%p): fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n",1723 LogRel(("Saved LEDs for KBD %d (%p): fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n", 1724 1724 (int)pKbd->idxPosition, pKbd, VBOX_BOOL_TO_STR_STATE(pKbd->LED.fNumLockOn), VBOX_BOOL_TO_STR_STATE(pKbd->LED.fCapsLockOn), 1725 1725 VBOX_BOOL_TO_STR_STATE(pKbd->LED.fScrollLockOn))); … … 1729 1729 pHidState->guestState.fCapsLockOn, pHidState->guestState.fScrollLockOn); 1730 1730 if (rc != 0) 1731 Log 2(("Unable to apply guest state to newly attached device\n"));1731 LogRel(("Unable to apply guest state to newly attached device\n")); 1732 1732 } 1733 1733 … … 1772 1772 if (RT_FAILURE(RTSemMutexCreate(&pHidState->fifoEventQueueLock))) 1773 1773 { 1774 Log 2(("Unable to create Lock for FIFO event queue\n"));1774 LogRel(("Unable to create Lock for FIFO event queue\n")); 1775 1775 CFRelease(pHidState->pFifoEventQueue); 1776 1776 pHidState->pFifoEventQueue = NULL; … … 1794 1794 } 1795 1795 else 1796 Log 2(("Unable to create a loop source\n"));1796 LogRel(("Unable to create a loop source\n")); 1797 1797 1798 1798 CFRelease(pTapRef); 1799 1799 } 1800 1800 else 1801 Log 2(("Unable to create an event tap\n"));1801 LogRel(("Unable to create an event tap\n")); 1802 1802 1803 1803 return kIOReturnError; … … 1887 1887 rc = IOHIDManagerClose(pHidState->hidManagerRef, 0); 1888 1888 if (rc != kIOReturnSuccess) 1889 Log 2(("Warning! Something went wrong in attempt to close HID device manager!\n"));1889 LogRel(("Warning! Something went wrong in attempt to close HID device manager!\n")); 1890 1890 } 1891 1891 … … 1941 1941 if (rc != 0) 1942 1942 { 1943 Log 2(("Unable to restore led states for device (%d)!\n", (int)i));1943 LogRel(("Unable to restore led states for device (%d)!\n", (int)i)); 1944 1944 rc2 = kIOReturnError; 1945 1945 } … … 1948 1948 IOHIDDeviceRegisterInputValueCallback(pKbd->pDevice, NULL, NULL); 1949 1949 1950 Log 2(("Restored LEDs for KBD %d (%p): fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n",1950 LogRel(("Restored LEDs for KBD %d (%p): fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n", 1951 1951 (int)i, pKbd, VBOX_BOOL_TO_STR_STATE(pKbd->LED.fNumLockOn), VBOX_BOOL_TO_STR_STATE(pKbd->LED.fCapsLockOn), 1952 1952 VBOX_BOOL_TO_STR_STATE(pKbd->LED.fScrollLockOn))); … … 1965 1965 if (rc != kIOReturnSuccess) 1966 1966 { 1967 Log 2(("Warning! Something went wrong in attempt to close HID device manager!\n"));1967 LogRel(("Warning! Something went wrong in attempt to close HID device manager!\n")); 1968 1968 rc2 = kIOReturnError; 1969 1969 } … … 2006 2006 if (elementMatchingDict) 2007 2007 { 2008 Log 2(("Start LEDs broadcast: fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n",2008 LogRel(("Start LEDs broadcast: fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n", 2009 2009 VBOX_BOOL_TO_STR_STATE(fNumLockOn), VBOX_BOOL_TO_STR_STATE(fCapsLockOn), VBOX_BOOL_TO_STR_STATE(fScrollLockOn))); 2010 2010 … … 2023 2023 fScrollLockOn); 2024 2024 if (rc != 0) 2025 Log 2(("Unable to restore led states for device (%d)!\n", (int)i));2025 LogRel(("Unable to restore led states for device (%d)!\n", (int)i)); 2026 2026 } 2027 2027 } 2028 2028 2029 Log 2(("LEDs broadcast completed\n"));2029 LogRel(("LEDs broadcast completed\n")); 2030 2030 2031 2031 CFRelease(elementMatchingDict);
Note:
See TracChangeset
for help on using the changeset viewer.