- From: Matt Reynolds <notifications@github.com>
- Date: Wed, 07 Jul 2021 16:22:16 -0700
- To: w3c/gamepad <gamepad@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/gamepad/pull/151/review/701521047@github.com>
@nondebug commented on this pull request. > + <ol> + <li>Let |gamepad:Gamepad| be the {{Gamepad}} instance in |navigator:Navigator|.{{[[gamepads]]}} representing the gamepad. + <li>Let |axisValues:sequence<unsigned long>| be the gamepad's <a>ordered array of logical axis input values</a>. + <li>Let |buttonValues:sequence<unsigned long>| 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<unsigned long>| and an <a>ordered array of logical button input values</a> |buttonValues:sequence<unsigned long>|, run the following steps: + <ol> + <li>Let |now:DOMHighResTimeStamp| be a {{DOMHighResTimeStamp}} representing the current time. + <li>Let |gamepadsStart:DOMHighResTimeStamp| be the |navigationStart:DOMHighResTimeStamp| attribute of the {{PerformanceTiming}} interface. + <li>Set |gamepad|.{{Gamepad/timestamp}} to |now| − |gamepadsStart|. + <li>Let |axisCount:long| be the length of |axisValues|. + <li>Initialize |rawAxisIndex:long| to be 0. + <li>While |rawAxisIndex| < |axisCount|: + <ol> + <li>Let |mappedIndex:long| be the value for key |rawAxisIndex| in |gamepad|.{{[[axisMapping]]}}. I've replaced the "value for key..." language with ordered map syntax but decided not to pull out |mapping|, maybe I should add it for readability? WDYT? -- 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_r665766544
Received on Wednesday, 7 July 2021 23:23:01 UTC