-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
How the testevdev test cases are produced #7801
Comments
@smcv can help you here |
Is there a way to use only USB vendor and product to detect gamepad? The current GUID is too strict. See this case, where an older version of the same gamepad isn't detected. |
Yes, the latest version of SDL will match USB VID/PID if the version doesn't match. |
Closing for now. If anyone knows how to produce test data (see first comment) please tell. |
That test data is currently only used to test I'd like to expand our test coverage to make more use of this data to test other functions over time, though! The test data mostly comes from the output of the If you're interested in providing more test data for an unusual device, you can either translate it yourself and open a pull request, or post the In general we don't need test data for ordinary Xbox/Playstation-style gamepads (particularly third-party clones of Microsoft/Sony/Nintendo controllers), unless they're something that SDL mis-detects. They can usually be grouped into very similar devices that only differ by their vendor/product/version, and if you look through the commit history you'll see that I added some of my colleague's test devices as comments rather than machine-readable data, because there's not much point in repeating the unit tests on a functionally equivalent device. If you have a device that is unusual, like a specialized simulation controller, then test data for that is a lot more interesting, because our heuristics for classifying devices might give the wrong answer for those. When a console manufacturer introduces a new generation (for instance the Playstation 6 will presumably have a new controller type), that's often also interesting to have listed, since it often has features that the previous generation didn't.
The "Supported events" become the
This translates to
If it wasn't all zeroes, we'd put this in
The line starting with
All the lines starting with
Everything after
Similarly everything after
...
...
...
...
... keyboard autorepeat ...
... and force feedback/haptics, which are certainly interesting for gamers, but not very interesting from the point of view of identifying whether something is a joystick or not, so we don't transcribe these either. Steam's |
Another piece of information which we don't collect yet, but we should, is the raw HID descriptor for the device. Not all input devices have one of these, but it should be available for all Bluetooth gamepads and most non-Xbox USB gamepads with a command like
|
Is it possible for you to enable Github discussion and turn this into a discussion thread? That way it's useful for other people as well. |
An update on this: in current versions of Steam (stable or beta, doesn't matter), you can run:
and it will output all the information we need, one blob of JSON per device. It has some options for which devices to inspect and how to present the information (use Usually the easiest way to use it is this:
If you want to also send a pull request that adds a mockup of your device to the unit test, first please copy/paste the whole JSON blob into an issue request or the PR description, so that we have the source information to refer back to if we add more features or we think there might be a mistake. Then, the JSON maps into the
|
I saw the commits below
How do I add a new controller test case for this? Is there some special software used to produce this?
The text was updated successfully, but these errors were encountered: