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

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

I believe that those states are actually just convenience booleans to indicate common hand gestures based on the touched states of the controls. Thumb and middle finger down + index up == IndexPointing. That could be easily handled at the JS level and is (IMO) far too specific of a concept to try to expose through this API.

> 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...

You hit on most of my reasoning for associating it with the button instead of the axis, actually. In pretty much all cases that I can see today the touchable controls also function as a button, and the button is a single element for the control, whereas there's often multiple axes for the single control. I'm also extremely loath to change the axes array right now, as it would be backwards-compatibility breaking in a big way. (We already went through that once with buttons.) Admittedly its not the most intuitive layout, but it maps well to many of the underlying APIs and seems to work well for the reality of how these devices are designed today. And, crucially, existing code can simply ignore it's existence.

> 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.

That sounds far more sensible than my proposal, actually! I can't think of any situation where you would have a control that is pressed but not touched. :)

> what about `active`, borrowing very loosely from the idea of active pointers?

I'm not completely opposed to it, but lacking the context provided by the pointer API I feel like it would be easily confused with the `pressed` state.

---
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-227567693

Received on Tuesday, 21 June 2016 20:51:47 UTC