kallaspriit/HTML5-JavaScript-Gamepad-Controller-Library — pull request #15 by dertseha (2013-07-02 17:02:40+00:00)
Title: Standard names for buttons & axes, reworked mapping mechanism

I've standardized the button and axis names as per #12 and reworked the mapping mechanism alongside with it.

Since the names and their expected index is now standardized, the mappings can be made more compact. As a further side result, a few of the explicit mappings could be dropped because they were the same as the standard mapping.
In this regard I dropped the UNSUPPORTED event since all gamepads can be supported, unknown ones are expected to match the standard mapping. This event won't be fired any more, its definition being marked deprecated.

Since I reworked the mapping layout, I also touched how _update() would parse it. Now it doesn't at all any more and simply calls specialized updater that have been compiled during _connect() .
I also removed public references of the mappings as I don't think they are of any use for the user of the library.

Mappings now also sport an 'environment' object that can contain any number of filter fields that limit the binding to this environment. Currently only platform and type are supported, but they could easily be extended to OS or more device specific identifier - more on that in #9.

The branch is based on #14 (and also on #13, I simply forgot to rebase, sorry)