Changeset 48930 in vbox
- Timestamp:
- Oct 7, 2013 7:20:52 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp
r48888 r48930 22 22 *******************************************************************************/ 23 23 #define LOG_GROUP LOG_GROUP_GUI 24 //#define VBOX_WITH_KBD_LEDS_SYNC24 #define VBOX_WITH_KBD_LEDS_SYNC 25 25 26 26 #include "DarwinKeyboard.h" … … 1185 1185 &kCFTypeDictionaryValueCallBacks); 1186 1186 1187 if (deviceMatchingDictRef) 1188 { 1189 CFRelease(usageKeyCFNumberRef); 1190 CFRelease(usagePageKeyCFNumberRef); 1191 1192 return deviceMatchingDictRef; 1193 } 1194 1187 1195 CFRelease(usageKeyCFNumberRef); 1188 CFRelease(usagePageKeyCFNumberRef);1189 1190 return deviceMatchingDictRef;1191 1196 } 1192 1197 … … 1220 1225 &kCFTypeDictionaryValueCallBacks); 1221 1226 1227 if (elementMatchingDictRef) 1228 { 1229 CFRelease(usagePageKeyCFNumberRef); 1230 return elementMatchingDictRef; 1231 } 1232 1222 1233 CFRelease(usagePageKeyCFNumberRef); 1223 return elementMatchingDictRef;1224 1234 } 1225 1235 … … 1284 1294 int rc2 = 0; 1285 1295 1286 matchingElementsArrayRef = IOHIDDeviceCopyMatchingElements(hidDevice, elementMatchingDict, 0);1296 matchingElementsArrayRef = IOHIDDeviceCopyMatchingElements(hidDevice, elementMatchingDict, kIOHIDOptionsTypeNone); 1287 1297 if (matchingElementsArrayRef) 1288 1298 { … … 1330 1340 int rc2 = 0; 1331 1341 1332 matchingElementsArrayRef = IOHIDDeviceCopyMatchingElements(hidDevice, elementMatchingDict, 0);1342 matchingElementsArrayRef = IOHIDDeviceCopyMatchingElements(hidDevice, elementMatchingDict, kIOHIDOptionsTypeNone); 1333 1343 if (matchingElementsArrayRef) 1334 1344 { … … 1484 1494 uint32_t vendorId = 0; 1485 1495 1486 pNumberRef = IOHIDDeviceGetProperty(pHidDeviceRef, CFSTR(kIOHIDVendorIDKey));1487 if (pNumberRef)1488 {1489 if ( CFGetTypeID(pNumberRef) == CFNumberGetTypeID())1490 { 1491 if (CF NumberGetValue((CFNumberRef)pNumberRef, kCFNumberSInt32Type, &vendorId))1496 if (pHidDeviceRef) 1497 { 1498 pNumberRef = IOHIDDeviceGetProperty(pHidDeviceRef, CFSTR(kIOHIDVendorIDKey)); 1499 if (pNumberRef) 1500 { 1501 if (CFGetTypeID(pNumberRef) == CFNumberGetTypeID()) 1492 1502 { 1493 switch (vendorId)1503 if (CFNumberGetValue((CFNumberRef)pNumberRef, kCFNumberSInt32Type, &vendorId)) 1494 1504 { 1495 case kIOUSBVendorIDAppleComputer: /** Apple devices always in the list */ 1496 case 0x03F0: /** Hewlett-Packard (verified with model KU-0316) */ 1497 fSupported = true; 1498 break; 1505 switch (vendorId) 1506 { 1507 case kIOUSBVendorIDAppleComputer: /** Apple devices always in the list */ 1508 case 0x03F0: /** Hewlett-Packard (verified with model KU-0316) */ 1509 fSupported = true; 1510 break; 1511 } 1512 1513 Log2(("HID device Vendor ID 0x%X %s in the list of supported devices.\n", vendorId, (fSupported ? "is" : "is not"))); 1499 1514 } 1500 1501 Log2(("HID device Vendor ID 0x%X %s in the list of supported devices.\n", vendorId, (fSupported ? "is" : "is not")));1502 1515 } 1503 } 1504 1505 CFRelease(pNumberRef);1516 1517 //CFRelease(pNumberRef); 1518 } 1506 1519 } 1507 1520 … … 1521 1534 if (hidsState) 1522 1535 { 1523 hidsState->hidManagerRef = IOHIDManagerCreate(kCFAllocatorDefault, 0);1536 hidsState->hidManagerRef = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone); 1524 1537 if (hidsState->hidManagerRef) 1525 1538 {
Note:
See TracChangeset
for help on using the changeset viewer.