[Bug 17309] It is not defined what the value of Gamepad.index should be after disconnecting the gamepad

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17309

--- Comment #9 from Scott Graham <scott.w3bugzilla@h4ck3r.net> ---
(In reply to comment #7)
> I suppose the followup question there is "should
> navigator.getGamepads()[<index of a disconnected gamepad>] return the
> gamepad object with .connected == false, or should it return null?

Hmm, good question. When there's no devices at all, I'm just returning
undefined which made the most sense at the time. Creating disconnected objects
for indices to infinity seems a bit strange.

Stepping back a bit... In the polling model, I'd honestly been thinking of them
as "values", not references to be held on to. So, the model was more that you'd
get data via navigator.getGamepads()[N], consume it, and then do the same next
time you wanted refreshed data. In that model, there wasn't even a connected
attribute required because you either got data or undefined in the array. I'm
not sure if that model helps though, given the other approach of onconnected
events and hanging on to the gamepad objects indefinitely.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 22 March 2013 15:55:11 UTC