Re: [w3c/gamepad] Length of getGamepads() array (#82)

In your scenario, the spec suggests that the length of the array should be 3:

> The length of the array returned MUST be one more than the maximum index value of the Gamepad objects returned in the array.

The disconnected gamepad (index 3) is not included in the array returned by getGamepads(), so the maximum index value is 2 and the array length is 3.

> In the event where all 4 gamepads are connected,

It's not clear to me why 4 gamepads is the limit. The spec doesn't define a limit and I think in general there's no reason why there should be a hard-coded limit. If an implementation supports an unlimited number of connected gamepads, what should the array returned from getGamepads() look like with no gamepads connected?

> I think we should think about the GamepadList not as a traditional list but as something akin to port assignments on a home console.

That sounds reasonable. Perhaps the array should grow and not shrink in order to preserve the indices of disconnected gamepads (in case they are reconnected).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/issues/82#issuecomment-413683226

Received on Thursday, 16 August 2018 21:01:02 UTC