This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21388 - handling of analog vs. digital buttons
Summary: handling of analog vs. digital buttons
Status: RESOLVED FIXED
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
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
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

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.