Bug 21388 - handling of analog vs. digital buttons
Summary: handling of analog vs. digital buttons
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Gamepad (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ted Mielczarek [:ted]
QA Contact: public-webapps-bugzilla
Depends on:
Reported: 2013-03-25 12:51 UTC by Ted Mielczarek [:ted]
Modified: 2013-10-11 16:28 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ted Mielczarek [:ted] 2013-03-25 12:51:48 UTC
Currently the spec represents buttons as an array of double values, to handle analog buttons (like the trigger buttons on most modern gamepads). However, I'm starting to think this might not be sufficient. The Playstation 3 controller, for example, has pressure-sensitive buttons which provide both a digital (pressed/not pressed) and an analog (how hard is it being pressed) value. It seems like it would be unfortunate to lose part of that data.

Should we spec button values to include both a boolean and a double value?
Comment 1 Ted Mielczarek [:ted] 2013-10-10 18:14:21 UTC
The recently-unveiled Gamepad framework in iOS 7/OS X 10.9 exposes buttons as a pressed+value pair:
Comment 2 Ted Mielczarek [:ted] 2013-10-11 16:28:52 UTC
I changed the buttons[] attribute to be of type GamepadButton, which has both pressed and value attributes:

This is the only breaking change I wanted to make to the spec.