Mailing Lists: Apple Mailing Lists

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

strange HID behavior



I have a special purpose mouse which seems to work correctly on Windows but which exhibits some unexpected behavior on OSX.

This device is primarily a pointing device with a number of extra buttons. The buttons can manifest as either mouse actions (left button, right button, etc.) or keyboard actions, including modifiers. The device acquires both mouse and keyboard functionality not with two separate USB Interfaces, but with one USB HID Interface (see the USB Descriptors below) by using the USB HID ReportID mechanism. Based on the USB Interface Protocol and Subclass, the Interface is a Boot Protocol Mouse.

The second USB Interface in the device is used for special configuration data.

The mouse tracking seems to work correctly.

All of the Mouse Buttons seem to map onto the Right Button in OSX, which means no Left Mouse Button -- making the device essentially useless as a mouse. (For example the "Left" button produces the HID report: 4d 01 00 00 00 00 00 00 (4d is the ReportID) but the Right button action)

The Keyboard actions are unusual as well; the keycodes seem to be off by one. (For example the HID Report 4b 00 04 00 00 00 00 00 produces a "b" in OSX instead of an "a")

I am trying to determine two things. 1) Are the HID Descriptors below wrong in some way? If so, I can probably get the vendor to change them, provided they don't lose Windows compatibility. 2) since there are units already in existence, can a Mac OS X Device Driver be deployed to "fix" the device's HID behavior.

I have made some progress on point #2 and have created a USB driver for the device (which inherits from IOHIDDevice in the normal way) which can successfully "repair" the keyboard HID Reports to produce the correct behavior. I haven't been able to figure out how to fix the mouse HID Reports. If the mouse HID Reports can't be fixed, my only idea is to attempt to post and synthesize those mouse actions directly without going through handleReport() in IOHIDDevice. I know how to do that in userland using CGPostMouseEvent(). What is the appropriate mechanism in the kernel?

Any comments or suggestions would be appreciated.

EH


Low Speed device @ 2 (0x3B100000): ............................................. Composite device: "BXX Device"
Device Descriptor
Descriptor Version Number: 0x0110
Device Class: 0 (Composite)
Device Subclass: 0
Device Protocol: 0
Device MaxPacketSize: 8
Device VendorID/ProductID: 0x1509/0x0303 (unknown vendor)
Device Version Number: 0x0300
Number of Configurations: 1
Manufacturer String: 1 "Bridge Work Systems, Inc."
Product String: 3 "BXX Device"
Serial Number String: 0 (none)
Configuration Descriptor
Length (and contents): 59
Raw Descriptor (hex) 0000: 09 02 00 3B 02 01 00 A0 32 09 04 00 00 01 03 01
Raw Descriptor (hex) 0010: 02 00 09 21 00 01 00 01 22 77 00 07 05 81 03 08
Raw Descriptor (hex) 0020: 00 0A 09 04 01 00 01 03 00 00 00 09 21 00 01 00
Raw Descriptor (hex) 0030: 01 22 22 00 07 05 82 03 08 00 0A
Number of Interfaces: 2
Configuration Value: 1
Attributes: 0xA0 (bus-powered, remote wakeup)
MaxPower: 100 ma
Interface #0 - HID/Boot Interface
Alternate Setting 0
Number of Endpoints 1
Interface Class: 3 (HID)
Interface Subclass; 1 (Boot Interface)
Interface Protocol: 2
HID Descriptor
Descriptor Version Number: 0x0100
Country Code: 0
Descriptor Count: 1
Descriptor 1
Type: 0x22 (Report Descriptor)
Length (and contents): 119
Raw Descriptor (hex) 0000: 05 01 09 02 A1 01 85 4D 05 09 19 01 29 08 15 00
Raw Descriptor (hex) 0010: 25 01 75 01 95 08 81 00 05 01 09 01 A1 00 09 30
Raw Descriptor (hex) 0020: 09 31 16 00 80 26 FF 7F 75 10 95 02 81 06 09 38
Raw Descriptor (hex) 0030: 15 81 25 7F 75 08 95 01 81 06 81 01 C0 C0 09 06
Raw Descriptor (hex) 0040: A1 01 85 4B 05 07 19 E0 29 E7 15 00 25 01 75 01
Raw Descriptor (hex) 0050: 95 08 81 02 19 01 29 52 15 00 25 52 75 08 95 06
Raw Descriptor (hex) 0060: 81 00 05 08 19 01 29 05 15 00 25 01 75 01 95 05
Raw Descriptor (hex) 0070: 91 02 95 03 91 01 C0
Parsed Report Descriptor:
Usage Page (Generic Desktop)
Usage (Mouse)
Collection (Application)
ReportID................ (77)
Usage Page (Button)
Usage Minimum........... (1)
Usage Maximum........... (8)
Logical Minimum......... (0)
Logical Maximum......... (1)
Report Size............. (1)
Report Count............ (8)
Input................... (Data, Array, Absolute)
Usage Page (Generic Desktop)
Usage (Pointer)
Collection (Physical)
Usage (X)
Usage (Y)
Logical Minimum......... (-32768)
Logical Maximum......... (32767)
Report Size............. (16)
Report Count............ (2)
Input................... (Data, Variable, Relative, No Wrap, Linear, Preferred State, No Null Position, Bitfield)
Usage (Wheel)
Logical Minimum......... (-127)
Logical Maximum......... (127)
Report Size............. (8)
Report Count............ (1)
Input................... (Data, Variable, Relative, No Wrap, Linear, Preferred State, No Null Position, Bitfield)
Input................... (Constant, Array, Absolute)
End Collection
End Collection
Usage (Keyboard)
Collection (Application)
ReportID................ (75)
Usage Page (Keyboard/Keypad)
Usage Minimum........... (224)
Usage Maximum........... (231)
Logical Minimum......... (0)
Logical Maximum......... (1)
Report Size............. (1)
Report Count............ (8)
Input................... (Data, Variable, Absolute, No Wrap, Linear, Preferred State, No Null Position, Bitfield)
Usage Minimum........... (1)
Usage Maximum........... (82)
Logical Minimum......... (0)
Logical Maximum......... (82)
Report Size............. (8)
Report Count............ (6)
Input................... (Data, Array, Absolute)
Usage Page (LED)
Usage Minimum........... (1)
Usage Maximum........... (5)
Logical Minimum......... (0)
Logical Maximum......... (1)
Report Size............. (1)
Report Count............ (5)
Output.................. (Data, Variable, Absolute, No Wrap, Linear, Preferred State, No Null Position, Nonvolatile, Bitfield)
Report Count............ (3)
Output.................. (Constant, Array, Absolute, No Wrap, Linear, Preferred State, No Null Position, Nonvolatile, Bitfield)
End Collection
Endpoint 0x81 - Interrupt Input
Address: 0x81 (IN)
Attributes: 0x03 (Interrupt no synchronization data endpoint)
Max Packet Size: 8
Polling Interval: 10 ms
Interface #1 - HID
Alternate Setting 0
Number of Endpoints 1
Interface Class: 3 (HID)
Interface Subclass; 0
Interface Protocol: 0
HID Descriptor
Descriptor Version Number: 0x0100
Country Code: 0
Descriptor Count: 1
Descriptor 1
Type: 0x22 (Report Descriptor)
Length (and contents): 34
Raw Descriptor (hex) 0000: 06 00 FF 09 01 A1 01 19 01 29 02 15 00 25 01 75
Raw Descriptor (hex) 0010: 01 95 40 81 00 19 01 29 02 91 00 19 01 29 02 B1
Raw Descriptor (hex) 0020: 00 C0
Parsed Report Descriptor:
Usage Page (65280)
Usage 1 (0x1)
Collection (Application)
Usage Minimum........... (1)
Usage Maximum........... (2)
Logical Minimum......... (0)
Logical Maximum......... (1)
Report Size............. (1)
Report Count............ (64)
Input................... (Data, Array, Absolute)
Usage Minimum........... (1)
Usage Maximum........... (2)
Output.................. (Data, Array, Absolute, No Wrap, Linear, Preferred State, No Null Position, Nonvolatile, Bitfield)
Usage Minimum........... (1)
Usage Maximum........... (2)
Feature................. (Data, Array, Absolute, No Wrap, Linear, Preferred State, No Null Position, Nonvolatile, Bitfield)
End Collection
Endpoint 0x82 - Interrupt Input
Address: 0x82 (IN)
Attributes: 0x03 (Interrupt no synchronization data endpoint)
Max Packet Size: 8
Polling Interval: 10 ms


_______________________________________________
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

This email sent to email@hidden


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.