Re: [gamepad] .gamepads vs. function access

pollGamepads() to me implies that the data would be refreshed by me calling
the function, which may be misleading if that's not the case.

.gamepads and .getGamepads() feel roughly equivalent in meaning to me,
though the former easier to write and read.

I could see code with the intent, "go check the gamepads and see if anything
new has happened". But I think a check for changed timestamps should suffice
there. IMHO the name doesn't need a fix.

On Tue, Oct 18, 2011 at 10:58 AM, Scott Graham <scottmg@google.com> wrote:

> Hi,
>
> Currently, the gamepad spec says it's navigator.gamepads to get
> polling-style access to the gamepad data.
>
> In writing some sample code, I'm finding it feels a bit odd because
> you don't know when the data is updated.
>
> I'm inclined towards "navigator.pollGamepads()" or maybe
> "navigator.getGamepads()" to make it more clear that you're getting a
> copy that's (hopefully) up-to-date at that point.
>
> Any positive or negative feelings on that?
>
> scott
>
>

Received on Wednesday, 19 October 2011 06:43:52 UTC