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

Okay, so the Steam controller API seems to just expose it as a pair of axes:
https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/public/steam/isteamcontroller.h#L63

The Vive is used via the OpenVR SDK, I guess? That seems to treat everything as axes as well:
https://github.com/ValveSoftware/openvr/wiki/IVRSystem::GetControllerState (seems like an awkward API, TBH)

The Oculus Touch hardware seems to map the best to what you're proposing here, since it literally has bit flags for "user is touching this button" for each of the buttons:
https://developer.oculus.com/documentation/pcsdk/latest/concepts/dg-input-touch-touch/

There are a few other things there that I don't know how you'd map to the Gamepad API, like `ovrTouch_RIndexPointing`.

The Daydream Controller also seems to map the touch point to a pair of axes, and also exposes `isTouching`, which is true if the user is touching the touchpad:
https://developers.google.com/vr/android/reference/com/google/vr/sdk/controller/Controller

For the DualShock 4, I'm not sure how you'd map more than one touch to the Gamepad API.

Kinda hard to find any info on the Shield Gamepad.

I think the Wii U Gamepad is pretty far out of scope. :)

I guess the only real qualm I have here is that for everything but the Oculus Touch, the 'touched' property corresponds to the *touchpad*, and you're just sort of exposing it as an additional button, which feels weird. They do all appear to be clickable like analog sticks, so maybe that's not the worst thing. The Gamepad API doesn't have any concept of mapping a pair of axes and a button together into a single unit, which maybe it should since every dual-analog gamepad functionally has two sticks that are each composed of a pair of axes and a button for clicking the stick, but you're not really making things worse in that regard.

Leaving aside that I don't actually know what you *use* the touched indicator for in VR games, I think this presents a little bit of a wart on the API, in that for non-VR controllers that don't have a touched indicator, the way you've proposed the spec text this is always going to be false, even if you're pressing the button in question, which seems odd. Do you think it'd be sensible to instead say something like "true if the button is capable of detecting touch and is currently touched, true if the button is pressed regardless of whether it is capable of detecting touch"? Sort of similar to how the spec states that for digital buttons, the `value` should be set to 0.0 or 1.0 for depressed or pressed.

---
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#issuecomment-227535633

Received on Tuesday, 21 June 2016 18:51:56 UTC