Closed GrosSacASac closed 5 years ago
Is there any guarantee that it is both unique(for all gamepads in the world) and immutable (for a given gamepad) ?
The id
field is incredibly underspecified in general. It came from my original implementation in Firefox where I just wanted some way to expose the vendor and product IDs from the USB device. USB vendor IDs are managed by the USB group, but I've definitely seen the same chipset used in several different cheap USB gamepads with the exact same vendor+product IDs, so it's not a very strong guarantee.
As to immutability, that should always hold true, and we could add spec text to that effect. I'm wary of trying to really spec out the id field, I think it wasn't a great idea in the first place and we should probably just spec something where we can expose things like the vendor and product IDs as separate fields when they're available.
Using VID:PID seems the most discriminant thing you can use, there is nothing really better that can be done until there are better ways to do local remapping (I see it is a Feature Request. Formally define the Id would be useful later for local remapping. Also adding the device name would be insignificant as names are even more shared then VID:PID.
I think for v1, it's just a string that might tell you something about the device type. For v2 we can try to separate out vid/pid, or something more helpful.
Is there any guarantee that it is both unique(for all gamepads in the world) and immutable (for a given gamepad) ?