[Bug 27444] New: Gamepad objects should have a dictionary of attributes about the controller and data source

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

            Bug ID: 27444
           Summary: Gamepad objects should have a dictionary of attributes
                    about the controller and data source
           Product: WebAppsWG
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Gamepad
          Assignee: ted@mielczarek.org
          Reporter: ted@mielczarek.org
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-webapps@w3.org

A few weeks ago some interested parties had an informal meetup at the Mozilla
office to discuss the issues surrounding the Gamepad API as-implemented. The
biggest issue we noted is the inconsistent mapping of controls across browsers
and operating systems. We talked at length about this, and it feels like a
really hard problem to solve. A number of people have written content libraries
to try to smooth this over (including myself and Scott):
https://github.com/luser/gamepadmapping.js
https://github.com/sgraham/gamepad.js
http://mozilla.github.io/galaxy.js/docs/galaxy.js.html#getGamepads

However, because of the differences across browsers and OSes the complexity
blows up quickly. (Example:
https://github.com/luser/gamepadmapping.js/blob/6dae0a5751df4acacfae2a5d3619758b7bb4bf43/gamepadmapping.js#L90
)

Specing things to remove this complexity might be possible, but it would be
hard. We think as a stopgap we can make things better by simply exposing more
information about the controller and the source of the data in a structured
manner, to allow content libraries to make better choices.

Right now there's an "id" string on the Gamepad object that is basically
unspecified (bug 25202). We should deprecate that in favor of a dictionary of
useful attributes. My proposal would be something like this:

dictionary GamepadAttributes {
  unsigned short? vendorId;
  unsigned short? productId;
  DOMString name;
  GamepadDataSource dataSource;
};

enum GamepadDataSource {
  "hid",
  "xinput",
  "linuxjoy",
  // other values
};

interface Gamepad {
  GamepadAttributes attributes; // Probably needs a better name
  ...
};

We'd like to see how well we can do with content libraries if we give them
better data, and this feels like it ought to be enough to work with.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Wednesday, 26 November 2014 14:34:47 UTC