Linux: Enumerate HID devices without USB parents - #31
Open
Tsuyumi25 wants to merge 2 commits into
Open
Conversation
This was referenced Sep 9, 2026
Open
Draft
Mrcubix
reviewed
Sep 9, 2026
Comment on lines
+139
to
+144
| int vendorStart = hidId.IndexOf(':'); | ||
| if (vendorStart < 0) { return false; } | ||
| vendorStart++; | ||
|
|
||
| int productStart = hidId.IndexOf(':', vendorStart); | ||
| if (productStart < 0 || productStart == hidId.Length - 1) { return false; } |
There was a problem hiding this comment.
What's the intent here ? can't a regex do the job better ?
Author
There was a problem hiding this comment.
Good point. A regex would work here, but string.Split is simpler for three fixed fields. I've replaced the manual indexing with it and added a short format comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linux currently drops hidraw devices without a
usb/usb_deviceparent, including Bluetooth HID devices.This keeps the existing USB enumeration path first and falls back to the
hidparent, reading the vendor and product IDs fromHID_IDand the product name fromHID_NAME. The libudev property binding is included for bothlibudev.so.0andlibudev.so.1.HID udev properties do not provide USB-equivalent release, manufacturer, or serial values, so the fallback uses release number
0and retains the existing missing-value behavior. Device-node permissions remain the consuming application's responsibility.This follows the HID-parent approach investigated by @digtail in #28.
Validated on Linux with Bluetooth Wacom CTL-4100WL and CTL-6100WL devices through OpenTabletDriver/OpenTabletDriver#4672.