W3C home > Mailing lists > Public > public-webevents@w3.org > October to December 2011

Re: [gamepad] .gamepads vs. function access

From: Vincent Scheib <scheib@google.com>
Date: Tue, 18 Oct 2011 23:42:57 -0700
Message-ID: <CAK-EfXnuURgBQ+7BY21QRPzXK7J3KyPmQYndYnoStP1J0L_3Ww@mail.gmail.com>
To: Scott Graham <scottmg@google.com>
Cc: public-webevents@w3.org
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:03:54 UTC