From be68590ce32ffc988530a72960571c87af84522c Mon Sep 17 00:00:00 2001 From: Matt Reynolds Date: Fri, 9 Feb 2024 11:04:00 -0800 Subject: [PATCH] Allow initializing the gamepad index to a specific value --- index.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 9587de4..4c903ae 100644 --- a/index.html +++ b/index.html @@ -650,8 +650,9 @@

Constructing a `Gamepad`

- A new `Gamepad` representing a connected gamepad device is - constructed by performing the following steps: + A new `Gamepad` with optional |index:long| representing a + connected gamepad device is constructed by performing the following + steps:

  1. Let |gamepad:Gamepad| be a newly created {{Gamepad}} instance: @@ -659,8 +660,14 @@

  2. Initialize |gamepad|'s {{Gamepad/id}} attribute to an identification string for the gamepad.
  3. -
  4. Initialize |gamepad|'s {{Gamepad/index}} attribute to the - result of [=selecting an unused gamepad index=] for |gamepad|. +
  5. Initialize |gamepad|'s {{Gamepad/index}} attribute to: +
      +
    • |index|, if |index| is provided, or +
    • +
    • The result of [=selecting an unused gamepad index=] for + |gamepad|. +
    • +
  6. Initialize |gamepad|'s {{Gamepad/mapping}} attribute to the result of [=selecting a mapping=] for the gamepad device.