Re: [w3c/gamepad] Add extended buttons to support trackpad (#191) (PR #196)

@mrmcpowned commented on this pull request.



> @@ -1018,6 +1030,13 @@ <h2>
             </li>
           </ol>
         </dd>
+        <dt>
+          <dfn>type</dfn> attribute
+        </dt>
+        <dd>
+          An enumeration, {{GamepadButtonType}}, that indicates which button types the controller
+          is being held in.
+        </dd>

Looks like we're still missing getter definitions, no?

> @@ -1018,6 +1030,13 @@ <h2>
             </li>
           </ol>
         </dd>
+        <dt>
+          <dfn>type</dfn> attribute
+        </dt>
+        <dd>
+          An enumeration, {{GamepadButtonType}}, that indicates which button types the controller
+          is being held in.

Is this phrasing in line with other specs? There's an [open spec issue](https://github.com/whatwg/html/issues/9832) regarding consistency in enum phrasing which makes me think this would be better phrased as:
> An enumerated {{GamepadButtonType}} attribute that classifies the current button's type in relation to an extended mapping

> +              <th scope="col">Gamepad Models</th>
+            </tr>

It feels like there's some disconnect with this table and the available GamepadButtonType enums. Are we missing a possible third column which maps each of these button to a respective GamepadButtonType?

> +              <td>Xbox Elite Wireless Controller</td>
+            </tr>
+            <tr>
+              <td>squeeze_right</td>
+             <td>Xbox Elite Wireless Controller<br>
+                PlayStation DualSense Edge</td>
+            </tr>
+            <tr>
+              <td>squeeze_right_lower</td>
+              <td>Xbox Elite Wireless Controller</td>
+            </tr>
+          </tbody>
+        </table>
+       <section>
+          <h3>
+            <dfn>GamepadButtonType</dfn> Enum

 I see 8 different classes of extended buttons in the table above, but only 2 applicable GamepadButtonTypes in the enum definition. Is the intention to expand the enum list below so we have a 1:1 mapping with the rows in the table? 

> +           <tr>
+              <td>share/capture</td>
+              <td>Xbox Wireless Controller Model 1914<br>
+                Nintendo Switch controllers<br>
+                Stadia controller<br>
+              </td>
+            </tr>
+           <tr>
+              <td>voice assistant</td>
+              <td>Google Stadia Controller<br>
+                Amazon Luna Controller<br>
+              </td>
+            </tr>
+            <tr>
+              <td>home</td>
+              <td>Nvidia Shield Gamepad</td>

The Xbox and PlayStation controllers have their own respective home buttons. Are we intending to add those to this list or is there some special reason why we're classifying this separately for the Shield gamepad?

> +          <p>
+            This enum defines the set of possible button types.
+          </p>
+          <pre class="idl">
+            enum GamepadButtonType {
+              "unknown",
+              "trackpad",
+              "share"
+            };
+          </pre>
+          <dl data-dfn-for="GamepadButtonType">
+            <dt>
+              <dfn>unknown</dfn>
+            </dt>
+            <dd>
+              This indicates button type is unknown or not applicable.

Is there a tangible benefit for User Agents to populate all the GamepadButtons with `unknown` for any buttons that can't be classified as one of the other types? Would it be better to simply have the attribute as `undefined` when that's the case? 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/pull/196#pullrequestreview-1965170887
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/gamepad/pull/196/review/1965170887@github.com>

Received on Thursday, 28 March 2024 05:27:45 UTC