- Timestamp:
- Nov 1, 2013 12:24:51 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp
r49352 r49361 1276 1276 rc = IOHIDDeviceSetValue(hidDevice, element, valueRef); 1277 1277 if (rc != kIOReturnSuccess) 1278 LogRel (("Warning! Something went wrong in attempt to turn %s HID device led (error %d)!\n", ((fEnabled) ? "on" : "off"), rc));1278 LogRel2(("Warning! Something went wrong in attempt to turn %s HID device led (error %d)!\n", ((fEnabled) ? "on" : "off"), rc)); 1279 1279 else 1280 LogRel (("Led (%d) is turned %s\n", (int)IOHIDElementGetUsage(element), ((fEnabled) ? "on" : "off")));1280 LogRel2(("Led (%d) is turned %s\n", (int)IOHIDElementGetUsage(element), ((fEnabled) ? "on" : "off"))); 1281 1281 1282 1282 CFRelease(valueRef); … … 1351 1351 if (rc != 0) 1352 1352 { 1353 LogRel (("Failed to set led (%d) state\n", (int)IOHIDElementGetUsage(element)));1353 LogRel2(("Failed to set led (%d) state\n", (int)IOHIDElementGetUsage(element))); 1354 1354 rc2 = kIOReturnError; 1355 1355 } … … 1398 1398 if (rc != 0) 1399 1399 { 1400 LogRel (("Failed to get led (%d) state\n", (int)IOHIDElementGetUsage(element)));1400 LogRel2(("Failed to get led (%d) state\n", (int)IOHIDElementGetUsage(element))); 1401 1401 rc2 = kIOReturnError; 1402 1402 } … … 1465 1465 } 1466 1466 1467 LogRel (("HID device [VendorID=0x%X, ProductId=0x%X] %s in the list of supported devices.\n", vendorId, productId, (fSupported ? "is" : "is not")));1467 LogRel2(("HID device [VendorID=0x%X, ProductId=0x%X] %s in the list of supported devices.\n", vendorId, productId, (fSupported ? "is" : "is not"))); 1468 1468 1469 1469 return fSupported; … … 1534 1534 if (fKeyDown) 1535 1535 { 1536 LogRel (("IOHID: KBD %d: Modifier Key-Down\n", (int)pKbd->idxPosition));1536 LogRel2(("IOHID: KBD %d: Modifier Key-Down\n", (int)pKbd->idxPosition)); 1537 1537 1538 1538 pEvent->pKbd = pKbd; … … 1550 1550 free(pEvent); 1551 1551 CFArrayRemoveValueAtIndex(pHidState->pFifoEventQueue, iQueue); 1552 LogRel (("IOHID: KBD %d: Modifier Key-Up (Key-Down %llu ms ago). Apple keyboard, removed from queue\n", (int)pKbd->idxPosition, tsDiff));1552 LogRel2(("IOHID: KBD %d: Modifier Key-Up (Key-Down %llu ms ago). Apple keyboard, removed from queue\n", (int)pKbd->idxPosition, tsDiff)); 1553 1553 } 1554 1554 else 1555 LogRel (("IOHID: KBD %d: Modifier Key-Up (Key-Down %llu ms ago)\n", (int)pKbd->idxPosition, tsDiff));1555 LogRel2(("IOHID: KBD %d: Modifier Key-Up (Key-Down %llu ms ago)\n", (int)pKbd->idxPosition, tsDiff)); 1556 1556 } 1557 1557 } … … 1559 1559 { 1560 1560 if (fKeyDown) 1561 LogRel (("IOHID: unable to find memory to queue KBD %d event\n", (int)pKbd->idxPosition));1561 LogRel2(("IOHID: unable to find memory to queue KBD %d event\n", (int)pKbd->idxPosition)); 1562 1562 else 1563 LogRel (("IOHID: unable to find KBD %d event in queue\n", (int)pKbd->idxPosition));1563 LogRel2(("IOHID: unable to find KBD %d event in queue\n", (int)pKbd->idxPosition)); 1564 1564 } 1565 1565 … … 1567 1567 } 1568 1568 else 1569 LogRel (("IOHID: No KBD: A modifier key has been pressed\n"));1569 LogRel2(("IOHID: No KBD: A modifier key has been pressed\n")); 1570 1570 } 1571 1571 } … … 1607 1607 /* Found one. Keep its index in queue in order to remove it later. */ 1608 1608 iEvent = i; 1609 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));1609 LogRel2(("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)); 1610 1610 break; 1611 1611 } 1612 1612 else 1613 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));1613 LogRel2(("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)); 1614 1614 1615 1615 pEvent = NULL; … … 1620 1620 VBoxKbdState_t *pKbd = pEvent->pKbd; 1621 1621 1622 LogRel (("CARBON: KBD %d: caps=%s, num=%s. tsKeyDown=%llu, tsKeyUp=%llu [tsDiff=%llu ms]. %d events in queue.\n",1622 LogRel2(("CARBON: KBD %d: caps=%s, num=%s. tsKeyDown=%llu, tsKeyUp=%llu [tsDiff=%llu ms]. %d events in queue.\n", 1623 1623 (int)pKbd->idxPosition, VBOX_BOOL_TO_STR_STATE(fCaps), VBOX_BOOL_TO_STR_STATE(fNum), 1624 1624 pEvent->tsKeyDown, pEvent->tsKeyUp, pEvent->tsKeyUp - pEvent->tsKeyDown, … … 1646 1646 } 1647 1647 else 1648 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)));1648 LogRel2(("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))); 1649 1649 } 1650 1650 … … 1665 1665 AssertReturnVoid(pHidState->pDeviceCollection); 1666 1666 1667 LogRel (("Forget KBD %d\n", (int)pKbd->idxPosition));1667 LogRel2(("Forget KBD %d\n", (int)pKbd->idxPosition)); 1668 1668 1669 1669 //if (RT_FAILURE(RTSemMutexRequest(pHidState->fifoEventQueueLock, RT_INDEFINITE_WAIT))) … … 1727 1727 if (rc != 0) 1728 1728 { 1729 LogRel (("Unable to get leds state for device %d. Mark leds as turned off\n", (int)(pKbd->idxPosition)));1729 LogRel2(("Unable to get leds state for device %d. Mark leds as turned off\n", (int)(pKbd->idxPosition))); 1730 1730 pKbd->LED.fNumLockOn = 1731 1731 pKbd->LED.fCapsLockOn = … … 1742 1742 CFArrayAppendValue(pHidState->pDeviceCollection, (void *)pKbd); 1743 1743 1744 LogRel (("Saved LEDs for KBD %d (%p): fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n",1744 LogRel2(("Saved LEDs for KBD %d (%p): fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n", 1745 1745 (int)pKbd->idxPosition, pKbd, VBOX_BOOL_TO_STR_STATE(pKbd->LED.fNumLockOn), VBOX_BOOL_TO_STR_STATE(pKbd->LED.fCapsLockOn), 1746 1746 VBOX_BOOL_TO_STR_STATE(pKbd->LED.fScrollLockOn))); … … 1750 1750 pHidState->guestState.fCapsLockOn, pHidState->guestState.fScrollLockOn); 1751 1751 if (rc != 0) 1752 LogRel (("Unable to apply guest state to newly attached device\n"));1752 LogRel2(("Unable to apply guest state to newly attached device\n")); 1753 1753 } 1754 1754 … … 1793 1793 if (RT_FAILURE(RTSemMutexCreate(&pHidState->fifoEventQueueLock))) 1794 1794 { 1795 LogRel (("Unable to create Lock for FIFO event queue\n"));1795 LogRel2(("Unable to create Lock for FIFO event queue\n")); 1796 1796 CFRelease(pHidState->pFifoEventQueue); 1797 1797 pHidState->pFifoEventQueue = NULL; … … 1815 1815 } 1816 1816 else 1817 LogRel (("Unable to create a loop source\n"));1817 LogRel2(("Unable to create a loop source\n")); 1818 1818 1819 1819 CFRelease(pTapRef); 1820 1820 } 1821 1821 else 1822 LogRel (("Unable to create an event tap\n"));1822 LogRel2(("Unable to create an event tap\n")); 1823 1823 1824 1824 return kIOReturnError; … … 1908 1908 rc = IOHIDManagerClose(pHidState->hidManagerRef, 0); 1909 1909 if (rc != kIOReturnSuccess) 1910 LogRel (("Warning! Something went wrong in attempt to close HID device manager!\n"));1910 LogRel2(("Warning! Something went wrong in attempt to close HID device manager!\n")); 1911 1911 } 1912 1912 … … 1962 1962 if (rc != 0) 1963 1963 { 1964 LogRel (("Unable to restore led states for device (%d)!\n", (int)i));1964 LogRel2(("Unable to restore led states for device (%d)!\n", (int)i)); 1965 1965 rc2 = kIOReturnError; 1966 1966 } … … 1968 1968 IOHIDDeviceUnscheduleFromRunLoop(pKbd->pDevice, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); 1969 1969 1970 LogRel (("Restored LEDs for KBD %d (%p): fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n",1970 LogRel2(("Restored LEDs for KBD %d (%p): fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n", 1971 1971 (int)i, pKbd, VBOX_BOOL_TO_STR_STATE(pKbd->LED.fNumLockOn), VBOX_BOOL_TO_STR_STATE(pKbd->LED.fCapsLockOn), 1972 1972 VBOX_BOOL_TO_STR_STATE(pKbd->LED.fScrollLockOn))); … … 1985 1985 if (rc != kIOReturnSuccess) 1986 1986 { 1987 LogRel (("Warning! Something went wrong in attempt to close HID device manager!\n"));1987 LogRel2(("Warning! Something went wrong in attempt to close HID device manager!\n")); 1988 1988 rc2 = kIOReturnError; 1989 1989 } … … 2026 2026 if (elementMatchingDict) 2027 2027 { 2028 LogRel (("Start LEDs broadcast: fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n",2028 LogRel2(("Start LEDs broadcast: fNumLockOn=%s, fCapsLockOn=%s, fScrollLockOn=%s\n", 2029 2029 VBOX_BOOL_TO_STR_STATE(fNumLockOn), VBOX_BOOL_TO_STR_STATE(fCapsLockOn), VBOX_BOOL_TO_STR_STATE(fScrollLockOn))); 2030 2030 … … 2043 2043 fScrollLockOn); 2044 2044 if (rc != 0) 2045 LogRel (("Unable to restore led states for device (%d)!\n", (int)i));2045 LogRel2(("Unable to restore led states for device (%d)!\n", (int)i)); 2046 2046 } 2047 2047 } 2048 2048 2049 LogRel (("LEDs broadcast completed\n"));2049 LogRel2(("LEDs broadcast completed\n")); 2050 2050 2051 2051 CFRelease(elementMatchingDict);
Note:
See TracChangeset
for help on using the changeset viewer.