Re: [w3c/gamepad] Enhance Gamepad interface description for Touch (PR #168)

@bradleyneedham commented on this pull request.



> +                <p>Let |normalizedY:float| be a value calculated from the current
+                  touch input y coordinate in relationship to the surfaceDimensionY
+                  and normalized to the range [-1.0, 1.0] where -1.0 is the topmost
+                  coordinate and 1.0 is the bottommost coordinate.
+                </p>
+                <p>
+                <p>Possible implementation:</p>
+                <ul>
+                  <li>`normalizedY = (2.0 * touchData.y / surfaceDimensionY) - 1`</li>
+                </ul>
+                </p>
+              </li>
+              <li>Let |touchEvent:GamepadTouch| be a {{GamepadTouch}}.
+              </li>
+              <li>Set |touchEvent|.{{GamepadTouch/touchId}} to be
+              `touchData.touchID`.

@nondebug I manually added the link, it appears that the dfn is not exported (or possibly, probably, I am not using xref correctly). I am also a little concerned that we are making the spec too restrictive to implementers, e.g. I am working on the DS4 GamepadTouch implementation in chromium and find that normalizing the touchId is much easier at the ds4_controller than the device/gamepad (this may be a bad assumption on my part that when you refer to an "internal slot" it would translate to that object). Requiring the nextTouchId in device/gamepad might cause difficulty in implementing other touch controllers. The specification just needs to be clear that implementers support 32 bit value starting at 0 and incrementing with each new touch event not associated with an existing active touch point. How this is accomplished should be open.
I will try and add some "Usage Examples" to better explain how applications will interact with the API.

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

Message ID: <w3c/gamepad/pull/168/review/1065612257@github.com>

Received on Monday, 8 August 2022 18:30:26 UTC