Hi all. I'm new to the list and while I searched the archives and
didn't find any helpful examples, I'm open to the possibility that I
missed something. If so, I apologize.
I've been attempting to figure out how to use the HID Utilities library
to perform a simple callback on input. It seemed simple enough so I
wrote this code:
for (pRecDevice d = HIDGetFirstDevice(); d; d = HIDGetNextDevice(d))
{
if (HIDQueueDevice(d) != kIOReturnSuccess)
{
puts("HIDQueueDevice() failed.");
continue;
}
if (HIDSetQueueCallback(d, handleInput) != kIOReturnSuccess)
puts("Failed to install the callback.");
}
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 3.0, false);
HIDReleaseDeviceList();
return 0;
}
This didn't work at all. It seemed that the callback was never being
called when I pressed the buttons even thought the printf statement
reported that it had found a device. (The HID_Manager_Test sample code
showed that it was the correct joystick--after I changed
kHIDUsage_GD_GamePad to kHIDUsage_GD_Joystick.)
I changed the usagePage and usage in the above code to 0 and re-ran the
code. After doing that the callback is called when I move the mouse or
type on the keyboard.
Am I doing something hideously wrong here?
Thanks,
- Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden