diff --git a/index.html b/index.html
index 6376806..66a63d8 100644
--- a/index.html
+++ b/index.html
@@ -656,13 +656,13 @@
- Let |gamepad:Gamepad| be a newly created {{Gamepad}} instance:
- - Initialize |gamepad|'s {{Gamepad/id}} attribute to an
+
- Initialize |gamepad|.{{Gamepad/id}} to an
identification string for the gamepad.
- - Initialize |gamepad|'s {{Gamepad/index}} attribute to the
+
- Initialize |gamepad|.{{Gamepad/index}} to the
result of [=selecting an unused gamepad index=] for |gamepad|.
- - Initialize |gamepad|'s {{Gamepad/mapping}} attribute to the
+
- Initialize |gamepad|.{{Gamepad/mapping}} to the
result of [=selecting a mapping=] for the gamepad device.
- Initialize |gamepad|.{{Gamepad/[[connected]]}} to `true`.
@@ -1702,17 +1702,70 @@
- [=list/For each=] |gamepad:Gamepad| of
[=this=].{{Navigator/[[gamepads]]}}:
- - If |gamepad| is not `null` and
- |gamepad|.{{Gamepad/[[exposed]]}} is `false`:
+
- If |gamepad| is `null` or |gamepad|.{{Gamepad/[[exposed]]}}
+ is `false`, [=list/append=] `null` to |gamepads|.
+
+ - Otherwise:
- - Set |gamepad|.{{Gamepad/[[exposed]]}} to `true`.
+
- Let |axesCopy| be a new [=list=].
+
+ - [=list/For each=] |axis| of
+ |gamepad|.{{Gamepad/[[axes]]}}, [=list/append=] |axis| to
+ |axesCopy|.
+
+ - Let |buttonsCopy| be a new [=list=].
- - Set |gamepad|.{{Gamepad/[[timestamp]]}} to |now|.
+
- [=list/For each=] |button| of
+ |gamepad|.{{Gamepad/[[buttons]]}}:
+
+ - Let |buttonCopy| be a newly created {{GamepadButton}}
+ instance:
+
+ - Initialize |buttonCopy|.{{GamepadButton/pressed}}
+ to |button|.{{GamepadButton/pressed}}.
+
+ - Initialize |buttonCopy|.{{GamepadButton/touched}}
+ to |button|.{{GamepadButton/touched}}.
+
+ - Initialize |buttonCopy|.{{GamepadButton/value}}
+ to |button|.{{GamepadButton/value}}.
+
+
+
+ - [=list/Append=] |buttonCopy| to |buttonsCopy|.
+
+
+
+ - Let |gamepadCopy:Gamepad| be a newly created {{Gamepad}}
+ instance:
+
+ - Initialize |gamepadCopy|'s {{Gamepad/id}} attribute
+ to |gamepad|.{{Gamepad/id}}.
+
+ - Initialize |gamepadCopy|'s {{Gamepad/index}}
+ attribute to |gamepad|.{{Gamepad/index}}.
+
+ - Initialize |gamepadCopy|'s {{Gamepad/mapping}}
+ attribute to |gamepad|.{{Gamepad/mapping}}.
+
+ - Initialize |gamepadCopy|.{{Gamepad/[[connected]]}} to
+ |gamepad|.{{Gamepad/[[connected]]}}.
+
+ - Initialize |gamepadCopy|.{{Gamepad/[[timestamp]]}} to
+ |gamepad|.{{Gamepad/[[timestamp]]}}.
+
+ - Initialize |gamepadCopy|.{{Gamepad/[[axes]]}} to
+ |axesCopy|.
+
+ - Initialize |gamepadCopy|.{{Gamepad/[[buttons]]}} to
+ |buttonsCopy].
+
+
+
+ - [=list/Append=] |gamepadCopy| to |gamepads|.
- - [=list/Append=] |gamepad| to |gamepads|.
-
- Return |gamepads|.