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

@nondebug commented on this pull request.



> @@ -258,6 +295,81 @@ <h2>
           different values (or values in a different order).
         </dd>
       </dl>
+      <h3>Receiving new input values</h3>
+      <p>
+        When the system receives new input values from a gamepad, run the following steps:
+      </p>
+      <ol>
+        <li>Let |gamepad:Gamepad| be the {{Gamepad}} instance in |navigator:Navigator|.{{[[gamepads]]}} representing the gamepad.
+        <li>Let |axisValues:sequence&lt;unsigned long&gt;| be the gamepad's <a>ordered array of logical axis input values</a>.
+        <li>Let |buttonValues:sequence&lt;unsigned long&gt;| be the gamepad's <a>ordered array of logical button input values</a>.
+        <li>Queue a task (where?) to <a>update gamepad state</a> for |gamepad| with |axisValues| and |buttonValues|.
+      </ol>
+      To <dfn>update gamepad state</dfn> for |gamepad| with an <a>ordered array of logical axis input values</a> |axisValues:sequence&lt;unsigned long&gt;| and an <a>ordered array of logical button input values</a> |buttonValues:sequence&lt;unsigned long&gt;|, run the following steps:

Added.

In another review it was pointed out that readonly attributes can't be updated after initialization (because they're read-only) so I've added internal slots for any attributes that may change after initialization and defined getter algorithms that refer to the internal slots.

-- 
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#discussion_r665768175

Received on Wednesday, 7 July 2021 23:28:12 UTC