You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Order in which index entries should be reused is unspecified.
The description of the index property on Gamepad states:
"if a gamepad is disconnected, and subsequently the same or a different gamepad is then connected, index entries must be reused."
So if I have 2 gamepads, then disconnect index 0, then connect a new gamepad, it should reuse index 0.
If I have 3 gamepads, then disconnect index 1, then connect a new gamepad, it should reuse index 1.
But what if I have 3 gamepads, disconnect index 1, then disconnect index 0.
Then connect a new gamepad.
Which index should it reuse? 0, which is the lowest unused index? Or 1, because it was the first disconnected index?
I would say 0, and suggest the spec state something like:
"if a gamepad is disconnected, and subsequently the same or a different gamepad is then connected, the lowest previously used index must be reused."
[reply] [−] Comment 1 Ted Mielczarek [:ted] 2014-06-25 19:02:28 UTC
Your suggestion is what Firefox implements (and I'm fairly certain Chrome), and is certainly the intended behavior.
The text was updated successfully, but these errors were encountered:
Originally filed as https://www.w3.org/Bugs/Public/show_bug.cgi?id=26203:
Brady Eidson 2014-06-25 18:55:54 UTC
Order in which index entries should be reused is unspecified.
The description of the index property on Gamepad states:
"if a gamepad is disconnected, and subsequently the same or a different gamepad is then connected, index entries must be reused."
So if I have 2 gamepads, then disconnect index 0, then connect a new gamepad, it should reuse index 0.
If I have 3 gamepads, then disconnect index 1, then connect a new gamepad, it should reuse index 1.
But what if I have 3 gamepads, disconnect index 1, then disconnect index 0.
Then connect a new gamepad.
Which index should it reuse? 0, which is the lowest unused index? Or 1, because it was the first disconnected index?
I would say 0, and suggest the spec state something like:
"if a gamepad is disconnected, and subsequently the same or a different gamepad is then connected, the lowest previously used index must be reused."
[reply] [−] Comment 1 Ted Mielczarek [:ted] 2014-06-25 19:02:28 UTC
Your suggestion is what Firefox implements (and I'm fairly certain Chrome), and is certainly the intended behavior.
The text was updated successfully, but these errors were encountered: