Skip to content

Commit

Permalink
Add extended buttons to support trackpad (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
xingri committed Mar 28, 2024
1 parent c207166 commit 64b7a26
Showing 1 changed file with 145 additions and 0 deletions.
145 changes: 145 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,7 @@ <h2>
readonly attribute boolean pressed;
readonly attribute boolean touched;
readonly attribute double value;
readonly attribute GamepadButtonType type;
};
</pre>
<p>
Expand Down Expand Up @@ -952,6 +953,17 @@ <h2>
.. 1.0]
</td>
</tr>
<tr>
<td>
<dfn data-dfn-for="GamepadButton">[[\type]]</dfn>
</td>
<td>
`undefined`
</td>
<td>
The button type of the controller.
</td>
</tr>
</table>
<dl>
<dt>
Expand Down Expand Up @@ -1018,6 +1030,13 @@ <h2>
</li>
</ol>
</dd>
<dt>
<dfn>type</dfn> attribute
</dt>
<dd>
An enumerated {{GamepadButtonType}} attribute that classifies the current button's type in relation to an
extended mapping.
</dd>
</dl>
</section>
<section data-dfn-for="GamepadMappingType">
Expand Down Expand Up @@ -1944,6 +1963,132 @@ <h2>
Visual representation of a [=Standard Gamepad=] layout.
</figcaption>
</figure>
<section>
<h3>
Extended Mapping
</h3>
<p>
This section introduces an extended gamepad button mapping beyond the Standard Gamepad layout.
These additional buttons are commonly found on certain gamepad models.
The following table defines the extended buttons used by some gamepad models in the following diagrams.
It’s important to note that this list is not exhaustive, and user agents may utilize different
or additional buttons for these or other gamepad models.
Consequently, the number of buttons on the Gamepad is not limited to the standard mapping of 17 buttons.
</p>
<p>
To accommodate extended gamepads, we have incorporated an "extended" mapping enumeration
into the GamepadMappingType. Additionally, we have defined an enumeration for the various
button types in the table, termed "GamepadButtonType", and have expanded the "GamepadButton"
interface to encompass this new button type enumeration.
</p>
<table class="tg">
<thead>
<tr>
<th scope="col">Buttons</th>
<th scope="col">Gamepad Models</th>
</tr>
</thead>
<tbody>
<tr>
<td>trackpad/touchpad</td>
<td>Sony DualSense, DualShock 4</td>
</tr>
<tr>
<td>share/capture</td>
<td>Nintendo Switch controllers<br>
Stadia controller<br>
Xbox Wireless Controller Model 1914</td>
</tr>
<tr>
<td>voice assistant</td>
<td>Amazon Luna Controller<br>
Google Stadia Controller<br>
Nvidia Shield Controller</td>
</tr>
<tr>
<td>squeeze_left</td>
<td>PlayStation DualSense Edge<br>
Xbox Elite Wireless Controller</td>
</tr>
<tr>
<td>squeeze_left_lower</td>
<td>Xbox Elite Wireless Controller</td>
</tr>
<tr>
<td>squeeze_right</td>
<td>PlayStation DualSense Edge<br>
Xbox Elite Wireless Controller</td>
</tr>
<tr>
<td>squeeze_right_lower</td>
<td>Xbox Elite Wireless Controller</td>
</tr>
</tbody>
</table>
<section>
<h3>
<dfn>GamepadButtonType</dfn> Enum
</h3>
<p>
This enum defines the set of possible button types.
</p>
<pre class="idl">
enum GamepadButtonType {
"trackpad",
"share",
"voice_assist",
"squeeze_left",
"squeeze_left_lower",
"squeeze_right",
"squeeze_right_lower"
};
</pre>
<dl data-dfn-for="GamepadButtonType">
<dt>
<dfn>trackpad</dfn>
</dt>
<dd>
This button is being assigned to trackpad button.
</dd>
<dt>
<dfn>share</dfn>
</dt>
<dd>
This button is being assigned to share or capture button.
</dd>
<dt>
<dfn>voice_assist</dfn>
</dt>
<dd>
This button is being assigned to voice assistance button.
</dd>
<dt>
<dfn>squeeze_left</dfn>
</dt>
<dd>
This button is being assigned to the left paddle button on the bottom of the gamepad.
</dd>
<dt>
<dfn>squeeze_left_lower</dfn>
</dt>
<dd>
This button is being assigned to the lower left paddle button on the bottom of the gamepad.
</dd>
<dt>
<dfn>squeeze_right</dfn>
</dt>
<dd>
This button is being assigned to the right paddle button on the bottom of the gamepad.
</dd>
<dt>
<dfn>squeeze_right_lower</dfn>
</dt>
<dd>
This button is being assigned to the lower right paddle button on the bottom of the gamepad.
</dd>
</dl>
</section>
</section>
<section>
<h3>
Fingerprinting mitigation
Expand Down

0 comments on commit 64b7a26

Please sign in to comment.