From 6947d1ed9f8585a0d1a36c2f53ee0d7ceef5b9ff Mon Sep 17 00:00:00 2001
From: Matt Reynolds
- Some [=user agent=]s have connected gamepad devices. These devices are
+ Some [=user agents=] have connected gamepad devices. These devices are
desirable and suited to input for gaming applications, and for "10
foot" user interfaces (presentations, media viewers).
tags
Use for top-level section headers
Use set/let/initialize consistently
Reorder [=queue a global task=] parameters to match the definition
Change [=queue a task=] to [=queue a global task=]
Always pass a global object to [=current high resolution time=]
---
index.html | 265 +++++++++++++++++++++++++++--------------------------
1 file changed, 133 insertions(+), 132 deletions(-)
diff --git a/index.html b/index.html
index 34287c5..5721354 100644
--- a/index.html
+++ b/index.html
@@ -86,7 +86,7 @@
Introduction
Specifically, we choose to only support the functionality required to
support gamepads. Support for gamepads requires two input types:
buttons and axes. Both buttons and axes are reported as analog values,
- buttons ranging from [0..1], and axes ranging from [-1..1].
+ buttons ranging from [0 .. 1], and axes ranging from [-1 .. 1].
While the primary goal is support for gamepad devices, supporting these @@ -296,7 +296,7 @@
This interface defines an individual gamepad device. @@ -466,7 +466,7 @@
- [=User agent=]s SHOULD set a minimum resolution of |gamepad|'s + [=User agents=] SHOULD set a minimum resolution of the {{Gamepad/timestamp}} attribute to 5 microseconds, following [[HR-TIME]]'s clock resolution recommendation.
@@ -579,10 +579,10 @@- The mapping in use for this device. If the user agent has knowledge - of the layout of the device, then it SHOULD indicate that a mapping - is in use by setting {{Gamepad/mapping}} to the corresponding - {{GamepadMappingType}} value. + The mapping in use for this device. If the [=user agent=] has + knowledge of the layout of the device, then it SHOULD indicate that + a mapping is in use by setting {{Gamepad/mapping}} to the + corresponding {{GamepadMappingType}} value.
To select a mapping for a @@ -603,16 +603,16 @@
Array of values for all axes of the gamepad. All axis values MUST - be linearly normalized to the range [-1.0 .. 1.0]. If the - controller is perpendicular to the ground with the directional - stick pointing up, -1.0 SHOULD correspond to "forward" or "left", - and 1.0 SHOULD correspond to "backward" or "right". Axes that are - drawn from a 2D input device SHOULD appear next to each other in - the axes array, X then Y. It is RECOMMENDED that axes appear in - decreasing order of importance, such that element 0 and 1 typically - represent the X and Y axis of a directional stick. The same object - MUST be returned until the [=user agent=] needs to return different - values (or values in a different order). + be linearly normalized to the range [-1 .. 1]. If the controller is + perpendicular to the ground with the directional stick pointing up, + -1 SHOULD correspond to "forward" or "left", and 1 SHOULD + correspond to "backward" or "right". Axes that are drawn from a 2D + input device SHOULD appear next to each other in the axes array, X + then Y. It is RECOMMENDED that axes appear in decreasing order of + importance, such that element 0 and 1 typically represent the X and + Y axis of a directional stick. The same object MUST be returned + until the [=user agent=] needs to return different values (or + values in a different order).
The {{Gamepad/axes}} getter steps are: @@ -687,8 +687,9 @@
@@ -697,7 +698,7 @@
If the Gamepad has multiple touch surfaces the touch @@ -890,21 +893,20 @@
- `x = (2.0 * touchData.x / surfaceDimensions.width) - 1` -
+ surface and normalized to [-1 .. 1] where -1 is the topmost + coordinate and 1 is the bottommost coordinate.
+ `x = (2.0 * touchData.x / surfaceDimensions.width) -
+ 1`
`y = (2.0 * touchData.y / surfaceDimensions.height) - 1`
Otherwise: @@ -1034,11 +1035,11 @@
- To initialize buttons for a - gamepad, run the following steps: + To initialize buttons for + |gamepad:Gamepad|, run the following steps:
Otherwise: @@ -1122,11 +1123,11 @@
The {{GamepadButton/pressed}} getter steps are: @@ -1272,10 +1274,10 @@
For buttons that have an analog sensor, this property MUST represent the amount which the button has been pressed. All button - values MUST be linearly normalized to the range [0.0 .. 1.0]. 0.0 - MUST mean fully unpressed, and 1.0 MUST mean fully pressed. For - buttons without an analog sensor, only the values 0.0 and 1.0 for - fully unpressed and fully pressed respectively, MUST be provided. + values MUST be linearly normalized to the range [0 .. 1]. 0 MUST + mean fully unpressed, and 1 MUST mean fully pressed. For buttons + without an analog sensor, only the values 0 and 1 for fully + unpressed and fully pressed respectively, MUST be provided.
The {{GamepadButton/value}} getter steps are: @@ -1312,39 +1314,39 @@
null.
+ If not available then `null`.
This enum defines the set of known mappings for a Gamepad. @@ -1377,7 +1379,7 @@
The {{GamepadHapticActuator/playEffect()}} method steps, called with {{GamepadHapticEffectType}} |type:GamepadHapticEffectType| and - {{GamepadEffectParameters}} |params:GamepadEffectParameters |, are: + {{GamepadEffectParameters}} |params:GamepadEffectParameters|, are:
The effect type defines how the effect parameters are interpreted by @@ -1781,7 +1782,7 @@
Given {{GamepadEffectParameters}} |params:GamepadEffectParameters|, @@ -1789,8 +1790,8 @@
Given {{GamepadEffectParameters}} |params:GamepadEffectParameters|, @@ -1838,8 +1839,8 @@
- A GamepadEffectParameters dictionary contains keys for
- parameters used by haptic effects. The meaning of each key is defined
- by the haptic effect, and some keys may be unused.
+ A `GamepadEffectParameters` dictionary contains keys for parameters
+ used by haptic effects. The meaning of each key is defined by the
+ haptic effect, and some keys may be unused.
To mitigate unwanted long-running effects, the [=user agent=] MAY limit @@ -1988,8 +1989,8 @@
// gamepads should look like [null, [object Gamepad]]
var gamepads = navigator.getGamepads();
@@ -2017,7 +2018,7 @@
return an empty [=list=].
requestAnimationFrame()
+ `requestAnimationFrame()`
Interactive applications will typically be using the {{AnimationFrameProvider/requestAnimationFrame()}} method to drive @@ -2409,9 +2410,9 @@
When a gamepad becomes available on the system, run the following steps: @@ -2423,8 +2424,8 @@
- User agents implementing this specification must provide a new DOM + [=User agents=] implementing this specification must provide a new DOM event, named {{gamepadconnected}}. The corresponding event MUST be of type {{GamepadEvent}} and MUST fire on the {{Window}} object.
@@ -2464,9 +2465,9 @@When a gamepad becomes unavailable on the system, run the following steps: @@ -2475,8 +2476,8 @@
- User agents implementing this specification must provide a new DOM + [=User agents=] implementing this specification must provide a new DOM event, named {{gamepaddisconnected}}. The corresponding event MUST be of type {{GamepadEvent}} and MUST fire on the {{Window}} object.
@@ -2517,9 +2518,9 @@
More discussion needed, on whether to include or exclude axis and
button changed events, and whether to roll them more together
@@ -2555,7 +2556,7 @@
- A [=document=]’s [=Document/permissions policy=] determines whether
+ A [=document=]'s [=Document/permissions policy=] determines whether
any content in that document is allowed to access
{{Navigator/getGamepads()}}. If disabled in any document, no content
in the document will be [=allowed to use=]
From 581221ad62326b6bbf697644896c2c16feac4e0a Mon Sep 17 00:00:00 2001
From: Matt Reynolds
steps:
- This interface defines an individual gamepad device. + This interface represents a [=gamepad=].
[Exposed=Window]
@@ -343,7 +343,7 @@
`true`
- An identification string for the gamepad. This string identifies - the brand or style of connected gamepad device. + The [=gamepad=]'s [=gamepad identifier string=].
The exact format of the {{Gamepad/id}} string is left unspecified. @@ -520,24 +476,15 @@
- Indicates whether the physical device represented by this object is - still connected to the system. When a gamepad becomes unavailable, - whether by being physically disconnected, powered off or otherwise - unusable, the {{Gamepad/connected}} attribute MUST be set to - `false`. + Indicates whether the [=gamepad=] is [=available=].
The {{Gamepad/connected}} getter steps are: @@ -552,14 +499,8 @@
- The {{Gamepad/timestamp}} allows the author to determine the last - time the {{Gamepad/axes}} or {{Gamepad/buttons}} attribute for this - gamepad was updated. The value MUST be set to the [=current high - resolution time=] each time the system [=receives new button or - axis input values=] from the device. If no data has been received - from the hardware, {{Gamepad/timestamp}} MUST be the [=current high - resolution time=] at the time when the {{Gamepad}} was first made - available to script. + The {{Gamepad/timestamp}} allows the author to determine when the + [=input values=] for this {{Gamepad}} updated.
[=User agents=] SHOULD set a minimum resolution of the @@ -579,18 +520,20 @@
- The mapping in use for this device. If the [=user agent=] has - knowledge of the layout of the device, then it SHOULD indicate that - a mapping is in use by setting {{Gamepad/mapping}} to the + Indicates whether inputs in the [=axis list=] and [=button list=] + are reordered when setting {{Gamepad}}.{{Gamepad/axes}} and + {{Gamepad}}.{{Gamepad/buttons}}. If the [=user agent=] has + knowledge of the [=input control layout=], then it SHOULD indicate + that a mapping is in use by setting {{Gamepad/mapping}} to the corresponding {{GamepadMappingType}} value.
To select a mapping for a - gamepad device, run the following steps: + [=gamepad=], run the following steps:
- Array of values for all axes of the gamepad. All axis values MUST - be linearly normalized to the range [-1 .. 1]. If the controller is - perpendicular to the ground with the directional stick pointing up, - -1 SHOULD correspond to "forward" or "left", and 1 SHOULD - correspond to "backward" or "right". Axes that are drawn from a 2D - input device SHOULD appear next to each other in the axes array, X - then Y. It is RECOMMENDED that axes appear in decreasing order of - importance, such that element 0 and 1 typically represent the X and - Y axis of a directional stick. The same object MUST be returned - until the [=user agent=] needs to return different values (or - values in a different order). + Array of values for all [=axis=] inputs of the [=gamepad=] + normalized to the range [-1 .. 1]. If the [=gamepad=] is + perpendicular to the ground with the thumbsticks pointing up, -1 + SHOULD correspond to "forward" or "left", and 1 SHOULD correspond + to "backward" or "right". [=Axis=] inputs with [=input values=] + from a thumbstick, joystick, or another input control that reports + X and Y values SHOULD appear next to each other in the + {{Gamepad/axes}} array, X then Y. It is RECOMMENDED that [=axis=] + inputs appear in decreasing order of importance, such that element + 0 and 1 typically represent the X and Y axes of a thumbstick or + joystick. The same object MUST be returned until the [=user agent=] + needs to return different values (or values in a different order).
The {{Gamepad/axes}} getter steps are: @@ -627,12 +571,13 @@
- Array of button states for all buttons of the gamepad. It is - RECOMMENDED that buttons appear in decreasing importance such that - the primary button, secondary button, tertiary button, and so on - appear as elements 0, 1, 2, ... in the buttons array. The same - object MUST be returned until the [=user agent=] needs to return - different values (or values in a different order). + Array of [=button=] states for all [=buttons=] of the [=gamepad=]. + It is RECOMMENDED that [=buttons=] appear in decreasing importance + such that the primary button, secondary button, tertiary button, + and so on appear as elements 0, 1, 2, ... in the + {{Gamepad/buttons}} array. The same object MUST be returned until + the [=user agent=] needs to return different values (or values in a + different order).
The {{Gamepad/buttons}} getter steps are: @@ -647,8 +592,8 @@
- A [=list=] of {{GamepadTouch}} objects generated from all touch - surfaces. + A [=list=] of {{GamepadTouch}} objects representing the current + contact points across all [=touch surfaces=].
The {{Gamepad/touches}} getter steps are: @@ -663,8 +608,8 @@
- A {{GamepadHapticActuator}} object that represents the device's - primary vibration actuator. + A {{GamepadHapticActuator}} object that represents the + [=gamepad=]'s [=vibration actuator=].
The {{Gamepad/vibrationActuator}} getter steps are: @@ -680,16 +625,27 @@
- When the system receives new button or axis input values, - run the following steps: + When an [=available=] [=gamepad=] has updated [=input values=], run + the following steps [=set/for each=] [=top-level traversable=] + |traversable| of the [=user agent=]'s [=user agent/top-level + traversable set=]:
@@ -697,8 +653,13 @@
+ To compute the normalized axis value for an [=axis=] + |rawAxis|: +
++ If |rawAxis| has a [=center position value=]: +
+To map and normalize buttons for |gamepad:Gamepad|, run the following steps:
- If the button has a digital switch to indicate a pure pressed - or released state, set |button|.{{GamepadButton/[[pressed]]}} - to `true` if the button is pressed or `false` if it is not - pressed. + If |rawButton| has a [=digital button value=], set + |button|.{{GamepadButton/[[pressed]]}} to the [=digital + button value=].
Otherwise, set |button|.{{GamepadButton/[[pressed]]}} to - `true` if the value is above the [=button press threshold=] - or `false` if it is not above the threshold. + `true` if the current [=normalized button value=] for + |rawButton| is above the [=button press threshold=] or + `false` if it is not above the threshold.
- If the button is capable of detecting touch, set - |button|.{{GamepadButton/[[touched]]}} to `true` if the - button is currently being touched. + If |rawButton| has a [=button touch value=], set + |button|.{{GamepadButton/[[touched]]}} to |rawButton|'s + [=button touch value=].
Otherwise, set |button|.{{GamepadButton/[[touched]]}} to @@ -846,6 +814,39 @@
+ To compute the normalized button value for a [=button=] + |rawButton|: +
+To record touches for |gamepad:Gamepad|, run the following steps: @@ -853,51 +854,51 @@
+ If |point| is [=part of an existing active touch point=], + set |touch|.{{GamepadTouch/touchId}} to the [=active + touch point id=]. +
++ Otherwise, set |touch|.{{GamepadTouch/touchId}} to |gamepad|.{{Gamepad/[[nextTouchId]]}} and increment |gamepad|.{{Gamepad/[[nextTouchId]]}}. -
- If the Gamepad has multiple touch surfaces the touch - id will be unique across surfaces. -
-+ If the {{Gamepad}} has multiple [=touch surfaces=] the + {{GamepadTouch/touchId}} will be unique across surfaces. +
`x = (2.0 * touchData.x / surfaceDimensions.width) - @@ -919,61 +920,60 @@
- A new `Gamepad` representing a connected gamepad device is - constructed by performing the following steps: + A new `Gamepad` representing an [=available=] [=gamepad=] + for a |window:Window| is constructed by performing the following + steps:
To select an unused - gamepad index for |gamepad:Gamepad|, run the following steps: + gamepad index given |window:Window|, run the following steps:
@@ -981,31 +981,16 @@
Otherwise: @@ -1157,8 +1127,8 @@
- This interface defines the state of an individual button on a gamepad - device. + This interface defines the state of an individual [=button=] on a + [=gamepad=] at a single point in time.
[Exposed=Window]
@@ -1192,7 +1162,7 @@
`false`
- A flag indicating that the button is pressed
+ A flag indicating that the [=button=] is pressed
@@ -1203,7 +1173,7 @@
`false`
- A flag indicating that the button is touched
+ A flag indicating that the [=button=] is touched
@@ -1211,11 +1181,11 @@
[[\value]]
- 0.0
+ 0
- A {{double}} representing the button value scaled to the range [0
- .. 1]
+ A {{double}} in the range [0 .. 1] representing the degree to which
+ the [=button=] is activated
@@ -1225,10 +1195,10 @@
-
- The pressed state of the button. This property MUST be `true` if
- the button is currently pressed, and `false` if it is not pressed.
- For buttons which do not have a digital switch to indicate a pure
- pressed or released state, the [=user agent=] MUST choose a
+ Indicates whether the [=button=] is pressed. This property MUST be
+ `true` if the button is currently pressed, and `false` if it is not
+ pressed. For buttons which do not have a digital switch to indicate
+ a pure pressed or released state, the [=user agent=] MUST choose a
button press threshold to indicate the button as pressed
when its value is above a certain amount. If the platform API gives
a recommended value, the [=user agent=] SHOULD use that. In other
@@ -1248,14 +1218,16 @@
-
- The touched state of the button. If the button is capable of
- detecting touch, this property MUST be `true` if the button is
- currently being touched, and `false` otherwise. If the button is
- not capable of detecting touch and is capable of reporting an
- analog value, this property MUST be `true` if the value property is
- greater than 0, and `false` if the value is 0. If the button is not
- capable of detecting touch and can only report a digital value,
- this property MUST mirror the {{GamepadButton/pressed}} attribute.
+ Indicates whether the [=button=] is detecting any interaction,
+ including interactions that do not cause the button to activate. If
+ the [=button=] has a [=button touch value=],
+ {{GamepadButton/touched}} is the [=button touch value=]. If the
+ [=button=] does not have a [=button touch value=] but has an
+ [=analog button value=], {{GamepadButton/touched}} is `true` if the
+ current [=analog button value=] is greater than the [=minimum
+ analog value=], otherwise `false`. If the [=button=] does not have
+ a [=button touch value=] or an [=analog button value=],
+ {{GamepadButton/touched}} mirrors {{GamepadButton/pressed}}.
The {{GamepadButton/touched}} getter steps are:
@@ -1270,12 +1242,15 @@
-
- For buttons that have an analog sensor, this property MUST
- represent the amount which the button has been pressed. All button
- values MUST be linearly normalized to the range [0 .. 1]. 0 MUST
- mean fully unpressed, and 1 MUST mean fully pressed. For buttons
- without an analog sensor, only the values 0 and 1 for fully
- unpressed and fully pressed respectively, MUST be provided.
+ A value in the range [0 .. 1] representing the degree to which the
+ [=button=] is activated. For [=buttons=] that have an [=analog
+ button value=], this property MUST be the [=analog button value=]
+ clamped to the [=minimum analog value=] and [=maximum analog
+ value=] and then linearly normalized to the range [0 .. 1]. 0 MUST
+ mean fully unpressed, and 1 MUST mean fully pressed. For
+ [=buttons=] without an [=analog button value=], only the values 0
+ and 1 for fully unpressed and fully pressed respectively, MUST be
+ provided.
The {{GamepadButton/value}} getter steps are:
@@ -1292,12 +1267,11 @@
GamepadTouch Interface
- This interface defines a touch on a gamepad's touch surface that
- supports such input. The object consists of a touch
- {{GamepadTouch/touchId}} that uniquely identifies the touch point from
- the time the input medium (e.g. finger, stylus, etc) makes contact with
- the touch device, up to the time the input medium is no longer making
- contact with the touch device.
+ This interface represents a [=touch point=] on a [=touch surface=]. The
+ object consists of a {{GamepadTouch/touchId}} that uniquely identifies
+ the [=touch point=] from the time the input medium (e.g. finger,
+ stylus, etc) makes contact with the [=touch surface=], up to the time
+ the input medium is no longer making contact with the surface.
dictionary GamepadTouch {
@@ -1312,33 +1286,37 @@
touchId attribute
-
- Unique id of the touch. Range is [0 .. 4294967295].
+ Identifier shared by [=touch points=] that are [=part of an existing
+ active touch point=]. Range is [0 .. 4294967295].
-
surfaceId attribute
-
- Unique id of the surface that generated the touch.
+ Identifier of the [=touch surface=] that generated the [=touch
+ point=].
-
position attribute
-
- A {{DOMPointReadOnly}} which holds the {{DOMPointReadOnly/x}},
- {{DOMPointReadOnly/y}} coordinates of the touch. The z and w value
- are currently unused. The range of each coordinate is normalized to
- [-1 .. 1]. Along the x-axis, -1 references the leftmost coordinate
- and 1 references the rightmost coordinate. Along the y-axis, -1
- references the topmost coordinate and 1 references the bottommost
- coordinate.
+ A {{DOMPointReadOnly}} which holds the normalized [=touch x
+ coordinate=] and [=touch y coordinate=] of the [=touch point=] as
+ {{DOMPointReadOnly/x}} and {{DOMPointReadOnly/y}}. The
+ {{DOMPointReadOnly/z}} and {{DOMPointReadOnly/w}} values are
+ currently unused. The range of each coordinate is normalized to [-1
+ .. 1]. Along the x-axis, -1 references the leftmost coordinate and 1
+ references the rightmost coordinate. Along the y-axis, -1 references
+ the topmost coordinate and 1 references the bottommost coordinate.
-
surfaceDimensions attribute
-
- A {{DOMRectReadOnly}} initialized with the {{DOMRectReadOnly/width}}
- and {{DOMRectReadOnly/height}} of the touch surface in integer units.
- If not available then `null`.
+ A {{DOMRectReadOnly}} initialized with the [=surface width=] and
+ [=surface height=] of the [=touch surface=] as
+ {{DOMRectReadOnly/width}} and {{DOMRectReadOnly/height}}, if the
+ [=touch surface=] has surface dimensions. Otherwise, `null`.
@@ -1347,7 +1325,8 @@
GamepadMappingType Enum
- This enum defines the set of known mappings for a Gamepad.
+ This enum defines the mapping types for mapping from a [=gamepad=] to a
+ {{Gamepad}}.
enum GamepadMappingType {
@@ -1361,21 +1340,25 @@
""
-
- The empty string indicates that no mapping is in use for this
- gamepad.
+ The empty string indicates that the [=gamepad=] does not have an
+ [=input control layout=], or the [=user agent=] does not know the
+ [=gamepad=]'s [=input control layout=], or the layout [=corresponds
+ with=] none of the standard layouts. The {{Gamepad/axes}} and
+ {{Gamepad/buttons}} arrays are not reordered.
-
"standard"
-
- The Gamepad's controls have been mapped to the [=Standard Gamepad=]
- layout.
+ The [=gamepad=]'s [=input control layout=] [=corresponds with=] the
+ [=Standard Gamepad=] layout. The {{Gamepad/axes}} and
+ {{Gamepad/buttons}} arrays are reordered.
-
"xr-standard"
-
- The Gamepad's controls have been mapped to the [="xr-standard"
+ The [=gamepad=]'s controls have been mapped to the [="xr-standard"
gamepad mapping=]. This mapping is reserved for use by the
[[[webxr-gamepads-module-1]]]. {{Gamepad}} objects returned by
{{Navigator/getGamepads()}} MUST NOT report a {{Gamepad/mapping}} of
@@ -1389,9 +1372,9 @@
GamepadHapticActuator Interface
- A {{GamepadHapticActuator}} corresponds to a configuration of motors or
- other actuators that can apply a force for the purposes of haptic
- feedback.
+ This interface represents a [=haptic actuator=] capable of playing
+ [=haptic effects=] that move the [=gamepad=] in a way that can be felt
+ by the user.
[Exposed=Window]
@@ -1452,10 +1435,11 @@
-
Array of {{Gamepad/GamepadHapticEffectType}} values representing
- all the types of haptic effects that the actuator supports. This
- property lists the {{Gamepad/GamepadHapticEffectType}} values that
- the actuator supports, unless the [=user agent=] does not support
- playing effects of that type.
+ all the types of [=haptic effects=] that the
+ {{GamepadHapticActuator}} supports. This property lists the
+ {{Gamepad/GamepadHapticEffectType}} values that the actuator
+ supports, unless the [=user agent=] does not support playing
+ effects of that type.
The {{GamepadHapticActuator/effects}} getter steps are:
@@ -1479,13 +1463,18 @@
effect=] of type |type:GamepadHapticEffectType|, return [=a promise
rejected with=] a {{TypeError}}.
- To issue a haptic effect on an actuator, the [=user agent=] - MUST send a command to the device to render an effect of - |type:GamepadHapticEffectType| and try to make it use the provided - |params:GamepadEffectParameters|. The [=user agent=] SHOULD use the - provided |playEffectTimestamp:DOMHighResTimestamp| for more precise - playback timing when |params|.{{GamepadEffectParameters/startDelay}} is - not `0.0`. The [=user agent=] MAY modify the effect to increase - compatibility. For example, an effect intended for a rumble motor may - be transformed into a waveform-based effect for a device that supports - waveform haptics but lacks rumble motors. + To play a haptic effect on a [=haptic actuator=], the [=user + agent=] MUST command the [=haptic actuator=] to render a [=haptic + effect=] of |type:GamepadHapticEffectType| and try to make it use the + provided |params:GamepadEffectParameters|. The [=user agent=] SHOULD + use the provided |playEffectTimestamp:DOMHighResTimeStamp| for more + precise playback timing when + |params|.{{GamepadEffectParameters/startDelay}} is not 0. The [=user + agent=] MAY modify the effect to increase compatibility. For example, + an effect intended for a rumble motor may be transformed into a + waveform-based effect for a device that supports waveform haptics but + lacks rumble motors.
- To stop haptic effects on an actuator, the [=user agent=] - MUST send a command to the device to abort any effects currently being - played. If a haptic effect was interrupted, the actuator SHOULD return - to a motionless state as quickly as possible. + To stop haptic effects on a [=haptic actuator=], the [=user + agent=] MUST command the [=haptic actuator=] to abort any effects + currently being played on that actuator. If a [=haptic effect=] was + interrupted, the actuator SHOULD return to a motionless state as + quickly as possible.
- When the |document|'s [=Document/visibility state=] becomes - `"hidden"`, run these steps for each {{GamepadHapticActuator}} - |actuator:GamepadHapticActuator|: + When the |document:Document|'s [=Document/visibility state=] becomes + `"hidden"`, run these steps:
A new |gamepadHapticActuator:GamepadHapticActuator| representing a - {{Gamepad}}'s primary vibration actuator is constructed by performing - the following steps: + [=gamepad=]'s [=vibration actuator=] is constructed by performing the + following steps:
- The haptic effected completed playing. + The [=haptic effect=] completed playing.
- The current effect was stopped or replaced (i.e., "preempted") by - another effect. + The current [=haptic effect=] was stopped or replaced (i.e., + "preempted") by another effect.
- The effect type defines how the effect parameters are interpreted by - the actuator. + Each value represents a different style of [=haptic effect=]. The + effect type defines how to generate a [=haptic effect=] from the + {{GamepadEffectParameters}}.
enum GamepadHapticEffectType {
@@ -1763,10 +1767,10 @@
{{GamepadHapticEffectType/"dual-rumble"}} describes a haptic
configuration with an eccentric rotating mass (ERM) vibration motor
- in each handle of a standard gamepad. In this configuration, either
- motor is capable of vibrating the whole gamepad. The vibration
+ in each handle of a [=gamepad=]. In this configuration, either
+ motor is capable of vibrating the whole [=gamepad=]. The vibration
effects created by each motor are unequal so that the effects of
- each can be combined to create more complex haptic effects.
+ each can be combined to create more complex [=haptic effects=].
A {{GamepadHapticEffectType/"dual-rumble"}} effect is a
@@ -1851,8 +1855,8 @@
A `GamepadEffectParameters` dictionary contains keys for parameters
- used by haptic effects. The meaning of each key is defined by the
- haptic effect, and some keys may be unused.
+ used by [=haptic effects=]. The meaning of each key is defined by the
+ haptic effect type, and some keys may be unused.
To mitigate unwanted long-running effects, the [=user agent=] MAY limit
@@ -1987,10 +1991,12 @@
Each device manufacturer creates many different products and each has - unique styles and layouts of buttons and axes. It is intended that the + unique styles and [=input control layouts=]. It is intended that the [=user agent=] support as many of these as possible.
@@ -2131,35 +2140,36 @@
- The [=Standard Gamepad=] buttons are laid out in a left cluster of four - buttons, a right cluster of four buttons, a center cluster of three - buttons, and a pair of front facing buttons on the left and right side - of the gamepad. The four axes of the "Standard Gamepad" are associated - with a pair of analog sticks, one on the left and one on the right. The - following table describes the buttons/axes and their physical - locations. + The [=Standard Gamepad=] [=buttons=] are laid out in a left cluster of + four [=buttons=], a right cluster of four [=buttons=], a center cluster + of three [=buttons=], and a pair of front facing [=buttons=] on the + left and right side of the [=gamepad=]. The four [=axis=] inputs of the + "Standard Gamepad" are associated with a pair of analog sticks, one on + the left and one on the right. The following table describes the input + controls and their physical locations.
- An axis input represents a Standard Gamepad axis if it - reports the input value for a thumbstick axis, the thumbstick is + An [=axis=] input represents a Standard Gamepad axis if it + reports the [=input values=] for a thumbstick axis, the thumbstick is located in approximately the same location as the corresponding - [=Standard Gamepad=] thumbstick, and the orientation of the axis + [=Standard Gamepad=] thumbstick, and the orientation of the [=axis=] (up-down or left-right) matches the orientation of the [=Standard - Gamepad=] axis. If there are multiple axes that represent the same - [=Standard Gamepad=] axis, then the [=user agent=] SHOULD select one to - be the [=Standard Gamepad=] axis and assign a different index to the - other axis. + Gamepad=] [=axis=]. If there are multiple [=axis=] inputs that + represent the same [=Standard Gamepad=] [=axis=], then the [=user + agent=] SHOULD select one to be the [=Standard Gamepad=] [=axis=] and + assign a different index to the other [=axis=].
- A button input represents a Standard Gamepad button if it - reports the input value for a button or trigger, and the button or - trigger is located in approximately the same location as the - corresponding [=Standard Gamepad=] button. + A [=button=] input represents a Standard Gamepad button if + it reports the [=input values=] for a button or trigger, and the button + or trigger is located in approximately the same location as the + corresponding [=Standard Gamepad=] button or trigger.
- If an axis or button input represents a [=Standard Gamepad=] axis or - button, then its canonical index - is the index of the corresponding [=Standard Gamepad=] axis or button. + If an [=axis=] or [=button=] input represents a [=Standard Gamepad=] + [=axis=] or [=button=], then its canonical index is the index of the + corresponding [=Standard Gamepad=] [=axis=] or [=button=].