Re: [AD] [PATCH] Fixed MacOS X issue where mice with more than one HIDusage/usagePage in the USB descriptor would fail to bedetected as a mouse.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Thanks, will test it out soon and let you know/apply it (looks OK).

Trent

----- Original Message ----- From: "Dennis Munsie" <dmunsie@xxxxxxxxxx>
To: <alleg-developers@xxxxxxxxxx>
Sent: Wednesday, July 30, 2014 1:35 PM
Subject: [AD] [PATCH] Fixed MacOS X issue where mice with more than one HIDusage/usagePage in the USB descriptor would fail to bedetected as a mouse.


Hi Everyone —

First time post/patch to here, so forgive me if I did something wrong. This patch is to fix the OS X HID code to detect mice when they are part of multi-function devices. In particular, I have a Microsoft Optical Mouse with Tilt Wheel that reports back multiple usage/usagePage values, and it’s primary values don’t happen to be generic desktop/mouse.

Thanks!
dennis

---
src/macosx/hidman.m | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/macosx/hidman.m b/src/macosx/hidman.m
index 6e5ac65..f62ee07 100644
--- a/src/macosx/hidman.m
+++ b/src/macosx/hidman.m
@@ -372,8 +372,8 @@ HID_DEVICE_COLLECTION *_al_osx_hid_scan(int type, HID_DEVICE_COLLECTION* col)
 /* Add key for device type to refine the matching dictionary. */
 usage_ref = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage);
usage_page_ref = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage_page); - CFDictionarySetValue(class_dictionary, CFSTR(kIOHIDPrimaryUsageKey), usage_ref); - CFDictionarySetValue(class_dictionary, CFSTR(kIOHIDPrimaryUsagePageKey), usage_page_ref); + CFDictionarySetValue(class_dictionary, CFSTR(kIOHIDDeviceUsageKey), usage_ref); + CFDictionarySetValue(class_dictionary, CFSTR(kIOHIDDeviceUsagePageKey), usage_page_ref);
 }
result = IOServiceGetMatchingServices(master_port, class_dictionary, &hid_object_iterator);
 if ((result == kIOReturnSuccess) && (hid_object_iterator)) {
--
1.9.3 (Apple Git-50)


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
--
https://lists.sourceforge.net/lists/listinfo/alleg-developers





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/