Bug 21388 - handling of analog vs. digital buttons
handling of analog vs. digital buttons
Status: RESOLVED FIXED
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Gamepad
unspecified
All All
: P2 normal
: ---
Assigned To: Ted Mielczarek [:ted]
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-25 12:51 UTC by Ted Mielczarek [:ted]
Modified: 2013-10-11 16:28 UTC (History)
3 users (show)

See Also:


Attachments

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:
https://developer.apple.com/library/ios/documentation/GameController/Reference/GCControllerButtonInput_Ref/Reference/Reference.html#//apple_ref/doc/c_ref/GCControllerButtonInput
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:
https://dvcs.w3.org/hg/gamepad/rev/a37c10a031b4

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