Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ <h2>
[Exposed=Window]
interface Gamepad {
readonly attribute DOMString id;
readonly attribute unsigned short? vendorId;
Comment thread
marcoscaceres marked this conversation as resolved.
readonly attribute unsigned short? productId;
Comment thread
marcoscaceres marked this conversation as resolved.
readonly attribute DOMString name;
readonly attribute long index;
readonly attribute boolean connected;
readonly attribute DOMHighResTimeStamp timestamp;
Expand Down Expand Up @@ -606,6 +609,47 @@ <h2>
{{Gamepad/id}} string.
</p>
</dd>
<dt>
<dfn>vendorId</dfn> attribute
</dt>
<dd>
<p>
The 16-bit identifier assigned to the device vendor by the USB
Implementers Forum or Bluetooth Special Interest Group, or `null`
if the gamepad has no vendor identifier or it is not available.
</p>
<p>
The [=user agent=] MAY set {{Gamepad/vendorId}} and
{{Gamepad/productId}} to `null` to mitigate the risk of exposing
device identifiers. If one of {{Gamepad/vendorId}} or
{{Gamepad/productId}} is `null` then both MUST be `null`.
</p>
</dd>
<dt>
<dfn>productId</dfn> attribute
</dt>
<dd>
The product identifier assigned by the device vendor, or `null` if
the gamepad has no product identifier or it is not available.
</dd>
<dt>
<dfn>name</dfn> attribute
</dt>
<dd>
<p>
A human-readable identifier for the gamepad. The exact content of
the {{Gamepad/name}} string is left unspecified. The [=user agent=]
MAY use a product name string provided by the device firmware. The
{{Gamepad/name}} MUST NOT be the empty string and MUST NOT include
unique identifiers like serial numbers or Bluetooth device
Comment thread
marcoscaceres marked this conversation as resolved.
addresses.
</p>
<p class="note">
The {{Gamepad/name}} is intended only as a user-facing identifier.
It is not a stable identifier and might change over time due to
updates to the device firmware, browser, or operating system.
</p>
</dd>
<dt>
<dfn>index</dfn> attribute
</dt>
Expand Down Expand Up @@ -1016,6 +1060,21 @@ <h3>
<li>Initialize |gamepad|'s {{Gamepad/id}} attribute to an
identification string for the gamepad.
</li>
<li>Initialize |gamepad|.{{Gamepad/vendorId}} to `null`</li>
<li>Initialize |gamepad|.{{Gamepad/productId}} to `null`.</li>
<li>If the gamepad has vendor and product identifiers:
<ol>
<li>Set |gamepad|.{{Gamepad/vendorId}} to the vendor
identifier.
</li>
<li>Set |gamepad|.{{Gamepad/productId}} to the product
identifier.
</li>
</ol>
</li>
<li>Initialize |gamepad|'s {{Gamepad/name}} attribute to a
human-readable identifier for the gamepad.
</li>
<li>Initialize |gamepad|'s {{Gamepad/index}} attribute to the
result of [=selecting an unused gamepad index=] for |gamepad|.
</li>
Expand Down