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

@bradleyneedham commented on this pull request.



> +          Receiving inputs</a> section of the main 
+          <a href="https://w3c.github.io/gamepad/">Gamepad specification</a>.
+        </p>
+        <p>
+          In addtion to the steps defined in the main 
+          <a href="https://w3c.github.io/gamepad/">Gamepad specification</a>.
+          When the user agent modifies the list of |active touch points| for a 
+          touch surface by adding touch points, removing touch points, 
+          or updating the values of existing touch points,
+          <dfn data-lt="updating touchEvents">update touchEvents</dfn>
+          by running the following steps:
+        </p>
+        <ol>
+          <li>Let |surfaceId:unsigned long| be 0.
+          </li>
+          <li>Let |touchSurfaces:list| be an [=ordered set=] of touch surfaces

> Normalizing touchId in Dualshock4Controller won't work because a device::Gamepad isn't 1-to-1 with a blink::Gamepad. Most of the time, "internal slot" should be read as "1-to-1 with blink::Gamepad". The only time we can attach internal slots to device::Gamepad is if all tabs should see the same value. This isn't true for touchId and nextTouchId since they may differ between tabs even for the same gamepad.

I went back and double checked and what I have observed is that the lifetime of a blink::Gamepad is very short maybe each render, so will not work for touchId and nextTouchId. This is probably not the forum for this discussion (I need to figure out how to start it over on the chromium site).
This does create an issue with implementing the specification since the lifetime of the device::Gamepad is not correct either as you point out.

> We want to emphasize the assumptions we're making about the inputs but we also don't want to specify more than we have to. I think we can modify the algorithm to be more specific about the assumptions we're making while being less specific about how the data is presented. For example, if we specify that a gamepad's touch surfaces need to have some consistent ordering then we can iterate over them without creating lists:

Agreed, I will work on addressing this.

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

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

Received on Tuesday, 9 August 2022 22:49:55 UTC