-
Notifications
You must be signed in to change notification settings - Fork 329
NEW: HIDAPI for Desktop Linux #2231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
NEW: HIDAPI for Desktop Linux #2231
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop #2231 +/- ##
===========================================
- Coverage 68.14% 68.13% -0.01%
===========================================
Files 367 367
Lines 53662 53662
===========================================
- Hits 36570 36565 -5
- Misses 17092 17097 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this PR @kalana-sahabandu. Changes look good to me if all that is needed is to enable the device mapping/layouts for Linux backend to work with these gamepads over HID and Linux backends now. Will this work across all support Unity versions though? I cannot see that there is version based conditions attached to enabling this for Desktop Linux?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. And good to have increased support for Gamepads on Linux.
Changes look fine. I assume we don't need a check for the availability of this feature in the package because the platform won't be sending any HID devices prior to that change, right? Just want to make sure you have tested this PR with Unity versions without the platform changes you mentioned, like @ekcoh has mentioned.
I just have a question: why do this only for Dualsense controllers? Why not all Sony controllers or even other controllers? I looked into the platform code you mentioned and basically it seems we have a new HID backend.
Are other controllers supported by SDL? And only the Dualsense is not supported?
@ekcoh @jfreire-unity Thank you so much for the reviews and the questions.
Quick question here: It will be Editor versions 2021.3 and up ?
So i have a quick question here, What are the other controllers New Input system access through HID ? If you could let me know a list of controllers that use HID for communication. I can definetly add them to the native implementation as well. Again, thank you both for the kind feedback, very much appreciated |
Description
Purpose of this PR is to bring HIDAPI support to Desktop Linux Platform along with HIDAPI support for PS5 controller. This PR adds necessary macros to following files to enable HIDAPI logic flow for Desktop Linux Platform (Editor and runtime):
Note that this PR only enables HID API path in the New Input package. All the platform related ground work (detection and disconnection, read and write) is handled in the native platform code (see: PLAT-15472, PLAT-15473, PLAT-15474)
Testing status & QA
Tested Linux Editor Detects PS5 controller through HIDAPI
Screencast from 2025-09-03 10-23-04.webm
Tested Linux Runtime detects PS5 controller through HIDAPI
Screencast from 2025-09-03 10-28-38.webm
Overall Product Risks
Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.
Comments to reviewers
Please describe any additional information such as what to focus on, or historical info for the reviewers.
Checklist
Before review:
Changelog entry added.
Changed
,Fixed
,Added
sections.Tests added/changed, if applicable.
Docs for new/changed API's.
During merge:
NEW: HIDAPI Support for Desktop Linux Platform
.After merge: