feat(CapabilityMap): add generic hidraw button driver#563
Open
honjow wants to merge 4 commits intoShadowBlip:mainfrom
Open
feat(CapabilityMap): add generic hidraw button driver#563honjow wants to merge 4 commits intoShadowBlip:mainfrom
honjow wants to merge 4 commits intoShadowBlip:mainfrom
Conversation
pastaq
requested changes
Mar 26, 2026
Contributor
pastaq
left a comment
There was a problem hiding this comment.
Much needed feature, thanks for working on this. I want to discuss a few things, so before you change anything below lets get to a consensus.
pastaq
reviewed
Mar 30, 2026
Contributor
pastaq
left a comment
There was a problem hiding this comment.
Thanks for making those changes. I'll test it this week and verify there are no strange effects in other hid devices.
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.
Summary
Add a generic hidraw button driver that uses capability map YAML configs to define button mappings, following the same pattern as existing evdev capability maps. This removes the need to write per-device Rust driver modules for simple HID button devices.
Includes GPD Win 5 HID button support (new firmware) as the first use case. Supersedes #558, which implements the same functionality with a dedicated driver.
Approach
The existing evdev source already uses a declarative approach — devices like MSI Claw and GPD define button mappings in YAML capability maps without any device-specific Rust code. This PR extends that pattern to hidraw by:
HidrawConfigwith flexible detection modes (non-zero byte, exact value match, specific bit check)HidrawEventTranslatorto translate raw HID reports based on the capability mapDriverType::Unknownbut a hidraw capability map is presentAdding support for a new simple HID button device now only requires a YAML capability map file — no Rust code or recompilation needed.
Test plan