Skip to content

Conversation

todbot
Copy link
Contributor

@todbot todbot commented Nov 26, 2019

Update of @fengji2006 PR#65, second try.

I think this includes all the requested changes, on top of the work done by @fengj2006 on #65. Unlike the previous attempt, I think this doesn't regress the other recent changes made.

You can now see all the different usages as different "devices" in hid_enumerate(). When running hidtest you see them too. On a Macbook Pro with internal keyboard/trackpad, there are many:

% ./hidtest | grep -E "(Product|Usage)"
  Product:      Apple Internal Keyboard / Trackpad
  Usage (page): 0x3 (0xff00)
  Product:      Apple Internal Keyboard / Trackpad
  Usage (page): 0xd (0xff00)
  Product:      Apple Internal Keyboard / Trackpad
  Usage (page): 0x2 (0x1)
  Product:      Apple Internal Keyboard / Trackpad
  Usage (page): 0x1 (0x1)
  Product:      Apple Internal Keyboard / Trackpad
  Usage (page): 0x5 (0xd)
  Product:      Apple Internal Keyboard / Trackpad
  Usage (page): 0xc (0xff00)
  Product:      Apple Internal Keyboard / Trackpad
  Usage (page): 0x6 (0x1)
  Product:      Apple Internal Keyboard / Trackpad
  Usage (page): 0x1 (0xc)
  Product:      Apple Internal Keyboard / Trackpad
  Usage (page): 0x6 (0xff00)
  Product:      Apple Internal Keyboard / Trackpad
  Usage (page): 0xb (0xff00)

Additionally, I've verified that an Arduino "RawHID" device with two usages shows up as two devices to hidapi. The device is a $9 Trinket M0 running TinyUSB pretending to be a Teensy in RawHID mode. See the "tinyusb_teensyrawhid_multiusage" sketch if you'd like to create a similar physical device to test against.

Update of @fengji2006 PR#65, second try
@todbot todbot added the macOS Related to macOS backend label Nov 26, 2019
Copy link
Member

@Youw Youw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good overall

@todbot todbot merged commit ca1a2d6 into libusb:master Dec 5, 2019
@Youw
Copy link
Member

Youw commented Dec 5, 2019

A small suggestion from my side:
When we do a squash merge, let's make a commit message clean.
E.g.: * apply requested changes and test is not informative in the master's commit history, so we better remove such entries.

@todbot
Copy link
Contributor Author

todbot commented Dec 5, 2019

Oh apologies. I debated what was the correct approach. Noted for next time. And thanks for being patient with me.

@Youw
Copy link
Member

Youw commented Dec 5, 2019

We're a team here :)

z3ntu added a commit to z3ntu/hidapi that referenced this pull request Apr 14, 2020
This reverts commit ca1a2d6.

Currently breaks razer_test, see libusb#155
Youw pushed a commit that referenced this pull request Nov 23, 2020
NOTE: This commit does not handle composite HID descriptors
I am interested in adding support for composite descriptors though I still need to find a
device with a composite descriptor to test it correctly.

The implementation idea is similar, as in #125 for macOS.
Youw pushed a commit that referenced this pull request Nov 23, 2020
NOTE: This commit does not handle composite HID descriptors
I am interested in adding support for composite descriptors though I still need to find a
device with a composite descriptor to test it correctly.

The implementation idea is similar, as in #125 for macOS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Related to macOS backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants