Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: HID Utils and queues



On Sun, 29 Sep 2002 23:32:43 +0100, <email@hidden> wrote:
> Does any know of any examples using the queuing mechanism using the HID
> utilities . I can see the the create & remove functions, which make sense,
> but

static void MyPollDevice (void)
{
recDevice searchDevice;
pRecDevice myRecDevice;

searchDevice.vendorID = 1118; // Microsoft
searchDevice.productID = 27; // SideWinder FFB 2 Joystick
searchDevice.usagePage = kHIDPage_GenericDesktop;
searchDevice.usage = kHIDUsage_GD_Joystick;

if (HIDFindDevice(&searchDevice, &myRecDevice))
{
if (kIOReturnSuccess == HIDQueueDevice(myRecDevice))
{
while (!Button())
{
IOHIDEventStruct tIOHIDEventStruct;
Boolean flush = false;

while (HIDGetEvent (myRecDevice, &tIOHIDEventStruct))
{
flush = true;

printf("\n MyPollDevice - Got Event: {t: 0x%2.2X, c:
%ld, v: 0x%8.8lX}.",
tIOHIDEventStruct.type,
(UInt32) tIOHIDEventStruct.elementCookie,
(tIOHIDEventStruct.longValueSize > 4) ? *(UInt32*)
tIOHIDEventStruct.longValue : tIOHIDEventStruct.value);
}
if (flush)
fflush(stdout);
}
HIDDequeueDevice(myRecDevice);
}
}
}

--
Enjoy,
George Warner,
Mixed Mode Magic Fragment Scientist
Apple Developer Technical Support (DTS)
_______________________________________________
mac-games-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-games-dev
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.