Re: [w3c/gamepad] Add algorithms for getGamepads and events (#151)

@marcoscaceres commented on this pull request.



> +      <ol>
+        <li>Let |gamepad:Gamepad| be the {{Gamepad}} instance in |navigator:Navigator|.{{Navigator/[[gamepads]]}} representing the gamepad.
+        <li>Queue a task (where?) to <a>update gamepad state</a> for |gamepad|.
+      </ol>
+      <p>
+        To <dfn>update gamepad state</dfn> for |gamepad|, run the following steps:
+      </p>
+      <ol>
+        <li>Let |now| be the [=current high resolution time=].
+        <li>Set |gamepad|.{{Gamepad/timestamp}} to |now|.
+        <li>Run the steps for <a>map and normalize axes</a> with |gamepad|.
+        <li>Run the steps for <a>map and normalize buttons</a> with |gamepad|.
+        <li>If |navigator|.{{Navigator/[[hasGamepadGesture]]}} is `false` and |gamepad| <a>contains a gamepad user gesture</a>:
+          <ol>
+            <li>Set |navigator|.{{Navigator/[[hasGamepadGesture]]}} to `true`.
+            <li>For each |connectedGamepad:Gamepad| of |navigator|.{{Navigator/[[gamepads]]}}:

Got motivated from our last tele conf and added nullable type support 😇

```suggestion
            <li>For each |connectedGamepad:Gamepad?| of |navigator|.{{Navigator/[[gamepads]]}}:
```

-- 
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/151#pullrequestreview-684074994

Received on Tuesday, 15 June 2021 14:20:55 UTC