From e6cfd4603c63ce42879159bd214a7f0c63a89444 Mon Sep 17 00:00:00 2001 From: Fernando L Attia Date: Wed, 28 Oct 2020 19:19:07 -0700 Subject: [PATCH 01/12] Add gamepad light indicator extension --- extensions.html | 111 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/extensions.html b/extensions.html index ce4f496..ea5951f 100644 --- a/extensions.html +++ b/extensions.html @@ -334,6 +334,109 @@

GamepadPose Interface

+ +
+

GamepadLightIndicatorType Enum

+

+ This enum defines the type of light indicators supported by gamepads. +

+ +
+        enum GamepadLightIndicatorType {
+          "on-off",
+          "rgb"
+        };
+      
+ +
+
"on-off"
+
+ Light indicator that supports a single color. +
+ +
"rgb"
+
+ Light indicator that supports multiple colors. +
+
+
+ +
+

GamepadLightColor

+

+ This represents the color of a light indicator. The default value should + be set to 0 for red, green, and blue. +

+ +
+        dictionary GamepadLightColor {
+          required octet red;
+          required octet green;
+          required octet blue;
+       };
+      
+ +
+
red
+
+ Red component of the light color, or non-zero value for an + on-off light indicator that indicates ON. +
+ +
green
+
+ Blue component of the light color, or non-zero value for an + on-off light indicator that indicates ON. +
+ +
blue
+
+ Green component of the light color, or non-zero value for an + on-off light indicator that indicates ON. +
+
+
+ +
+

GamepadLightIndicator

+

+ This interface defines a light indicator. +

+ +
+        [Exposed=Window, SecureContext]
+        interface GamepadLightIndicator {
+          readonly attribute GamepadLightIndicatorType type;
+        
+          Promise<long> setColor(GamepadLightColor color);
+      };
+      
+ +
+
type
+
+ Type of light indicator supported by the gamepad. +
+ +
setColor
+
+ Sets the color of a light indicator, or sets the light indicator to ON + or OFF. + + For on-off light indicators, one or more non zero values + denotes the light indicator is ON, whereas a zero value for all + components indicates the light indicator is OFF. + + For RGB light indicators, one or more non zero values specify the + color of the light indicator, whereas all zero values indicate the + light indicator is OFF. + + The returned Promise will resolve true when setting the + color has succeeded, and will reject the device API error code on + failure. +
+
+

Partial Gamepad Interface

@@ -347,6 +450,8 @@

Partial Gamepad Interface

readonly attribute GamepadHand hand; readonly attribute FrozenArray<GamepadHapticActuator> hapticActuators; readonly attribute GamepadPose? pose; + readonly attribute FrozenArray<GamepadLightIndicator>? + lightIndicators; }; @@ -371,6 +476,12 @@

Partial Gamepad Interface

hardware cannot supply any pose values, MUST be set to null. + +
lightIndicators
+
+ A list of all light indicators in the gamepad. null if + the gamepad does not have or does not support a light indicator. +
From 2a7d14df83877f2a3a290dd64a23c938db730a48 Mon Sep 17 00:00:00 2001 From: fernando-80 <31781050+fernando-80@users.noreply.github.com> Date: Thu, 29 Oct 2020 22:24:58 -0700 Subject: [PATCH 02/12] Update extensions.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- extensions.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extensions.html b/extensions.html index ea5951f..9494efd 100644 --- a/extensions.html +++ b/extensions.html @@ -450,8 +450,7 @@

Partial Gamepad Interface

readonly attribute GamepadHand hand; readonly attribute FrozenArray<GamepadHapticActuator> hapticActuators; readonly attribute GamepadPose? pose; - readonly attribute FrozenArray<GamepadLightIndicator>? - lightIndicators; + readonly attribute FrozenArray<GamepadLightIndicator>? lightIndicators; }; From 2044611b09504f3a0c6533479915f6f689befa4a Mon Sep 17 00:00:00 2001 From: fernando-80 <31781050+fernando-80@users.noreply.github.com> Date: Thu, 29 Oct 2020 22:25:52 -0700 Subject: [PATCH 03/12] Update extensions.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- extensions.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions.html b/extensions.html index 9494efd..c9a84dd 100644 --- a/extensions.html +++ b/extensions.html @@ -420,20 +420,28 @@

GamepadLightIndicator

setColor
+

Sets the color of a light indicator, or sets the light indicator to ON or OFF. +

+

For on-off light indicators, one or more non zero values denotes the light indicator is ON, whereas a zero value for all components indicates the light indicator is OFF. +

+

For RGB light indicators, one or more non zero values specify the color of the light indicator, whereas all zero values indicate the light indicator is OFF. +

+

The returned Promise will resolve true when setting the color has succeeded, and will reject the device API error code on failure. +

From 2c92bb94aefe219a5b8f602b6d92eebf020526fb Mon Sep 17 00:00:00 2001 From: fernando-80 <31781050+fernando-80@users.noreply.github.com> Date: Tue, 2 Mar 2021 08:46:39 -0800 Subject: [PATCH 04/12] Update extensions.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- extensions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions.html b/extensions.html index d6545df..22c073a 100644 --- a/extensions.html +++ b/extensions.html @@ -418,7 +418,7 @@

GamepadLightIndicator

Type of light indicator supported by the gamepad. -
setColor
+
setColor()
method

Sets the color of a light indicator, or sets the light indicator to ON From e8f4dd0c6c55dfe7d47ddbe9894f48a4e64664fb Mon Sep 17 00:00:00 2001 From: fernando-80 <31781050+fernando-80@users.noreply.github.com> Date: Tue, 2 Mar 2021 08:46:47 -0800 Subject: [PATCH 05/12] Update extensions.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- extensions.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions.html b/extensions.html index 22c073a..38bfb24 100644 --- a/extensions.html +++ b/extensions.html @@ -427,8 +427,8 @@

GamepadLightIndicator

For on-off light indicators, one or more non zero values - denotes the light indicator is ON, whereas a zero value for all - components indicates the light indicator is OFF. + denotes the light indicator is on, whereas a zero value for all + components indicates the light indicator is off.

From 12c2ca7bf3ef08010e9ea1b4c7d043b61fba5dbb Mon Sep 17 00:00:00 2001 From: fernando-80 <31781050+fernando-80@users.noreply.github.com> Date: Tue, 2 Mar 2021 08:47:03 -0800 Subject: [PATCH 06/12] Update extensions.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- extensions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions.html b/extensions.html index 38bfb24..ea8fee8 100644 --- a/extensions.html +++ b/extensions.html @@ -508,7 +508,7 @@

Partial Gamepad Interface

readonly attribute GamepadHand hand; readonly attribute FrozenArray<GamepadHapticActuator> hapticActuators; readonly attribute GamepadPose? pose; - readonly attribute FrozenArray<GamepadLightIndicator>? lightIndicators; + readonly attribute FrozenArray<GamepadLightIndicator> lightIndicators; readonly attribute FrozenArray<GamepadTouch>? touchEvents; }; From d988007ca874bb3cb18deac50b767919bd084087 Mon Sep 17 00:00:00 2001 From: fernando-80 <31781050+fernando-80@users.noreply.github.com> Date: Tue, 2 Mar 2021 08:47:14 -0800 Subject: [PATCH 07/12] Update extensions.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- extensions.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions.html b/extensions.html index ea8fee8..db4a936 100644 --- a/extensions.html +++ b/extensions.html @@ -537,8 +537,8 @@

Partial Gamepad Interface

lightIndicators
- A list of all light indicators in the gamepad. null if - the gamepad does not have or does not support a light indicator. + A list of all light indicators in the gamepad. The array is empty if + the gamepad does not have, or does not support, a light indicator.
touchEvents
From e839fae72beb4f6d4686c5c5da3c54e04a9cc448 Mon Sep 17 00:00:00 2001 From: fernando-80 <31781050+fernando-80@users.noreply.github.com> Date: Tue, 2 Mar 2021 08:47:24 -0800 Subject: [PATCH 08/12] Update extensions.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- extensions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions.html b/extensions.html index db4a936..54736a4 100644 --- a/extensions.html +++ b/extensions.html @@ -377,7 +377,7 @@

GamepadLightColor

-
red
+
red
member
Red component of the light color, or non-zero value for an on-off light indicator that indicates ON. From af0ddebbb67e17abfee4d4c238825935fab49b52 Mon Sep 17 00:00:00 2001 From: fernando-80 <31781050+fernando-80@users.noreply.github.com> Date: Tue, 2 Mar 2021 08:47:31 -0800 Subject: [PATCH 09/12] Update extensions.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- extensions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions.html b/extensions.html index 54736a4..6849c14 100644 --- a/extensions.html +++ b/extensions.html @@ -389,7 +389,7 @@

GamepadLightColor

on-off light indicator that indicates ON.
-
blue
+
blue
member
Green component of the light color, or non-zero value for an on-off light indicator that indicates ON. From de4aadef4074a8665aaac6a1ca1f248dae17f69b Mon Sep 17 00:00:00 2001 From: fernando-80 <31781050+fernando-80@users.noreply.github.com> Date: Tue, 2 Mar 2021 08:47:41 -0800 Subject: [PATCH 10/12] Update extensions.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- extensions.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions.html b/extensions.html index 6849c14..28e4a1e 100644 --- a/extensions.html +++ b/extensions.html @@ -370,9 +370,9 @@

GamepadLightColor

         dictionary GamepadLightColor {
-          required octet red;
-          required octet green;
-          required octet blue;
+          octet red = 0;
+          octet green = 0;
+          octet blue = 0;
        };
       
From d7c79f6ac6ad11eff643bf1f3e87810d79ced364 Mon Sep 17 00:00:00 2001 From: fernando-80 <31781050+fernando-80@users.noreply.github.com> Date: Tue, 2 Mar 2021 08:48:07 -0800 Subject: [PATCH 11/12] Update extensions.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marcos Cáceres --- extensions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions.html b/extensions.html index 28e4a1e..67b9513 100644 --- a/extensions.html +++ b/extensions.html @@ -383,7 +383,7 @@

GamepadLightColor

on-off light indicator that indicates ON.
-
green
+
green
member
Blue component of the light color, or non-zero value for an on-off light indicator that indicates ON. From 313072de425673a57c0f03d41ab084406f3cc90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20C=C3=A1ceres?= Date: Fri, 9 Apr 2021 09:11:49 +1000 Subject: [PATCH 12/12] Apply suggestions from code review --- extensions.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/extensions.html b/extensions.html index 67b9513..cc34b99 100644 --- a/extensions.html +++ b/extensions.html @@ -362,10 +362,9 @@

GamepadLightIndicatorType Enum

-

GamepadLightColor

+

GamepadLightColor dictionary

- This represents the color of a light indicator. The default value should - be set to 0 for red, green, and blue. + This represents the color of a light indicator.

@@ -408,7 +407,7 @@ 

GamepadLightIndicator

interface GamepadLightIndicator { readonly attribute GamepadLightIndicatorType type; - Promise<long> setColor(GamepadLightColor color); + Promise<undefined> setColor(GamepadLightColor color); };
@@ -539,7 +538,7 @@

Partial Gamepad Interface

A list of all light indicators in the gamepad. The array is empty if the gamepad does not have, or does not support, a light indicator. - +
touchEvents
A list of touch events generated from all touch surfaces. null