W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2012

[gamepad] Polling access point

From: Scott Graham <scottmg@chromium.org>
Date: Thu, 26 Jul 2012 16:02:21 -0700
Message-ID: <CANHK6RaNvF0rTFuiL-2v92RryGCGjtWgAyi+XiQjPQkkOio+Gw@mail.gmail.com>
To: public-webapps@w3.org
Cc: Ted Mielczarek <ted@mielczarek.org>

It looks like the access point for the polling part of the API
(navigator.gamepads[]) is not a good idea.

Based on a prototype implementation, pages seem to have a tendency to
enumerate Navigator. When the .gamepads[] attribute is accessed, it causes
possibly expensive background resources to be created to access hardware,
even though the content is not really interested in reading data from the

Possible solutions:
- change from navigator.gamepads[] to navigator.gamepads() (or
navigator.getGamepads()) to be more explicit about when the API is actually
being used
- require something to activate the API (meta tag, calling some sort of
"start" function)
- require registering for at least one gamepad-related event before data is
provided in gamepads[].
- make .gamepads[] non-enumerable

Any thoughts or other suggestions?

Received on Thursday, 26 July 2012 23:02:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:37 UTC