diff --git a/index.html b/index.html index 8ca6304..78c1407 100644 --- a/index.html +++ b/index.html @@ -136,6 +136,68 @@
+ A gamepad is a physical or virtual input device that provides + button and/or axis inputs. The host is the operating system + environment hosting the user agent. The host provides an algorithm for + enumerating connected gamepads. A + gamepad is considered connected when the host is capable of + reading new inputs. A gamepad that is not connected is + disconnected. +
++ The [=host=] provides an algorithm for synchronously + reading input data from the gamepad. If the host does not + provide such an algorithm, the user agent MAY implement an algorithm + that caches the most recent input data and synchronously returns the + cached value. +
++ When a gamepad transitions from disconnected to connected, it + becomes connected. Likewise, when a gamepad transitions from + connected to disconnected, it becomes disconnected. The host + provides algorithms to register listeners for these transitions. If + these events are not available, the user agent MAY implement an + algorithm that synthesizes the events by periodically enumerating + connected gamepads. +
++ The user agent MUST define a gamepad user gesture. A gamepad + user gesture is a class of gamepad input state transitions that signify + that the user is interacting with the gamepad. At a minimum, the gamepad + user gesture MUST include state changes where any button transitions + from unpressed to pressed. Other transitions can be included as user + gestures. A transition MUST NOT be included if the transition could + occur without user interaction. +
++ The user agent MUST NOT expose information about connected gamepads + until a gamepad user gesture has been received from any connected + gamepad. The user gesture MUST be tracked independently for each gamepad + context. A gamepad context MUST be created when a page first + requests the current gamepad state or registers for gamepad connection + events. The gamepad context MUST be destroyed when the tab is closed or + navigates away from the current page. Reloading the current page MUST + NOT destroy the gamepad context. +
+TODO: Integrate the gamepad context lifetime with the HTML spec.
+