[w3c/gamepad] Added touched property to GamepadButton (#26)

This is my proposal for adding explicit touchpad support to the Gamepad spec. Seems like creating a pull request here may be a more productive way to fostering conversation around the feature than the mailing list, which was relatively quiet on the subject.

It seems to me that effective touchpad support should only require this single new attribute. Touchpad position can accurately be represented by the existing `axes` array, but developers will need to be able to disambiguate between `[0, 0]` being a centered touch or no touch at all. That can be handled via the existing `pressed` value in a button, but it's awkward both in name and use. Many touchpads are clickable, meaning that the single control may have both a touched an a pressed state. Having a touched and a pressed state on a single button allows us to track both states while logically associating them with a single physical control. Furthermore some touchpads are pressure sensitive, but it's hard to imagine that such a control would also have separate tracking for clicked pressure, so the single existing `value` attribute should cover both touch pressure and button pressed amount.

There is also some upcoming hardware ([Oculus Touch](https://www.oculus.com/en-us/touch/)) for which many of the physical buttons will also have capacitive touch tracking to determine the position of the fingers. Adding a `touched` property to the buttons serves that case well.

There still exists some ambiguity over which button is associated with which axes, but that's a pre-existing problem and this addition doesn't make it any worse. This also ignores multi-touch surfaces (The PS4 controller has one) but considering the large amount of effort that has gone into supporting multi-touch for mobile devices it seems like that's not something we want to duplicate into the gamepad API.

You can view, comment on, or merge this pull request online at:

  https://github.com/w3c/gamepad/pull/26

-- Commit Summary --

  * Added touched property to GamepadButton

-- File Changes --

    M index.html (8)

-- Patch Links --

https://github.com/w3c/gamepad/pull/26.patch
https://github.com/w3c/gamepad/pull/26.diff

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/pull/26

Received on Wednesday, 15 June 2016 16:44:10 UTC