@@ -317,8 +317,9 @@ static int seize_wait(hid_dev_t handle){
317
317
// HACK: We shouldn't seize the HID device until it's successfully added to the service registry.
318
318
// Otherwise, OSX might think there's no keyboard/mouse connected.
319
319
long location = usbgetlong (handle , CFSTR (kIOHIDLocationIDKey ));
320
- char location_str [18 ];
321
- snprintf (location_str , sizeof (location_str ), "@%lx" , location );
320
+ char location_var [18 ], location_fixed [18 ];
321
+ snprintf (location_var , sizeof (location_var ), "@%lx" , location );
322
+ snprintf (location_fixed , sizeof (location_fixed ), "@%08x" , (int )location );
322
323
// Open master port (if not done yet)
323
324
static mach_port_t master = 0 ;
324
325
kern_return_t res ;
@@ -341,7 +342,7 @@ static int seize_wait(hid_dev_t handle){
341
342
IORegistryEntryGetPath (child_service , kIOServicePlane , path );
342
343
IOObjectRelease (child_service );
343
344
// Look for an entry that matches the location of the device and says "HID". If found, we can proceed with adding the device
344
- if (strstr (path , location_str ) && strstr (path , "HID" )){
345
+ if (( strstr (path , location_var ) || strstr ( path , location_fixed ) ) && strstr (path , "HID" )){
345
346
IOObjectRelease (child_iter );
346
347
return 0 ;
347
348
}
0 commit comments