From bcfe048a8f184d124c73a5dbe16e04d77f5c8643 Mon Sep 17 00:00:00 2001 From: Matt Reynolds Date: Thu, 4 Jun 2020 15:29:42 -0700 Subject: [PATCH 1/2] Add a Model section --- index.html | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/index.html b/index.html index 2048375..190d125 100644 --- a/index.html +++ b/index.html @@ -204,6 +204,67 @@

sensing, depth sensing, video analysis, gesture recognition, and so on.

+ +
+

+ Model +

+

+ 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. +

+

+ To register a user gesture, a gamepad context MUST be active. A gamepad + context is active if the document associated with the context + is [=Document/visible=]. If the document is [=Document/hidden=], the + context is inactive. When a context is first created or when it + transitions from inactive to active, it becomes active. + Likewise, when it transitions from active to inactive, it becomes + inactive. +

+
+

Gamepad interface From 9ff12161938327c2105a46ad3ff9e1a46a7d22ee Mon Sep 17 00:00:00 2001 From: Matt Reynolds Date: Thu, 16 Jul 2020 16:22:58 -0700 Subject: [PATCH 2/2] Update index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 190d125..f608400 100644 --- a/index.html +++ b/index.html @@ -251,10 +251,11 @@

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. + NOT destroy the gamepad context.

-

+

+

TODO: Integrate the gamepad context lifetime with the HTML spec.

+
To register a user gesture, a gamepad context MUST be active. A gamepad context is active if the document associated with the context is [=Document/visible=]. If the document is [=Document/hidden=], the