-
Notifications
You must be signed in to change notification settings - Fork 48
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
"STANDARD GAMEPAD" should be defined in a separate attribute #129
Comments
And, since the standard suggest a setup of inputs to comply with the "standard gamepad" the API should give the axis and button names. I mean should the developer have to go to the w3 standard to know what axis is what. If we have a input setup the developer should be able to call the "x" axis or the "b" button instead of using index. With that being said, the type attribute give the developer all the information needed to know what inputs that's available. |
The inclusion of a vendor and product attribute would be welcomed as it would provide more usable metadata for application developers to use. Is what you're proposing that the mapping attribute be completely removed? I don't know how well that would work in terms of existing implementations since the standard mapping as per the spec is defined in relation to the gamepads for the two most used platforms (Xbox and Playstation). I'm honestly not even sure if the mapping attribute has been of much help, though. The spec defined that the "standard" layout is relative to the button mapping shown on the spec page, but if that mapping were to change to accommodate for some new "standard", that would make using the attribute value useless in terms of validating such a mapping. In my personal usage of the API, I haven't really relied much on the attribute itself, and more on the actual button/axis mapping information as per the spec. |
The ID string format isn't specified by the spec (even if it maybe should have been), the "STANDARD GAMEPAD" string is inserted by Chrome only when https://html5gamepad.com/controllers conveniently logs all the ID strings it has seen. In Chrome, the ID string is one of these: %s (Vendor: %04x Product: %04x) <-- unrecognized HID gamepad There are XInput IDs for different controller types, I've never actually seen any of these except STANDARD GAMEPAD: Xbox 360 Controller (XInput STANDARD GAMEPAD) In Firefox: %04x-%04x-%s We can't modify I don't think we should expose the vendor/manufacturer name reported by the device. This information isn't as useful for identification because different devices from the same vendor may report different strings. Sometimes Chrome pulls the vendor name into the ID string because it's included by the platform API used for device enumeration, for instance here's DS4 v1 and DS4 v2 on different platforms: Wireless Controller (STANDARD GAMEPAD Vendor: 054c Product: 05c4) Wireless Controller (STANDARD GAMEPAD Vendor: 054c Product: 09cc) It really shouldn't include the vendor name string but it's too late to change it. Also note that the vendor name is reported differently for DS4 v1 vs DS4 v2 even though the vendor ID is the same. Modifying your example (new attributes in bold): id: whatever is currently reported |
The suggested change is liked by me. |
Currently the type of controller is added to the id attribute. This makes the developer having to do a ".includes('STANDARD GAMEPAD')" for the id. Not ideal. So I suggest that the gamepad API have a specific attribute for this:
id: "uuid"
mapping: "standard"
type: "standard gamepad"
vendor: "Microsoft"
product: "Xbox 360 Controller"
The text was updated successfully, but these errors were encountered: