diff --git a/index.html b/index.html index 23f3344..3b74579 100644 --- a/index.html +++ b/index.html @@ -311,7 +311,7 @@

`null` - List of generated touch events. + List of generated touches. @@ -477,9 +477,9 @@

- A list of {{GamepadTouch}} events generated from all touch - surfaces. If the device does not support touch events, MUST be set - to `null`. + A list of {{GamepadTouch}} objects generated from all touch + surfaces. If the device does not support touches, MUST be set to + `null`.

The {{Gamepad/touches}} getter steps are: @@ -683,26 +683,19 @@

steps:

    -
  1. Let |surfaceId:unsigned long| be 0. -
  2. -
  3. Remove any existing events from +
  4. Remove any existing objects from {{Gamepad}}.{{Gamepad/[[touches]]}}.
  5. Repeat the following steps for each touch surface on |gamepad| in touch surface enumeration order:
      -
    1. Let |surfaceDimensions| be an `null`. +
    2. Let |surfaceId:unsigned long| be the current surface + enumeration index.
    3. If the touch surface exposes maximum surface dimensions in - device units: -
        -
      1. Set |touchEvent|.{{GamepadTouch/surfaceDimensions}}[0] to - the maximum X dimension on the touch surface in device units. -
      2. -
      3. Set |touchEvent|.{{GamepadTouch/surfaceDimensions}}[1] to - the maximum Y dimension on the touch surface in device units. -
      4. -
      + device units, then set |touch|.{{GamepadTouch/surfaceDimensions}} + to a {{DOMRect}} with `width` and `height` initialized to the + maximum X and Y dimensions on the touch surface in device units.
    4. Repeat the following steps for each active touch point reported by the |gamepad| for the current touch surface. @@ -710,16 +703,15 @@

    5. Let |nextTouchId:unsigned long| be the next available touchId for the |gamepad|.
    6. -
    7. Let |touchEvent:GamepadTouch| be a {{GamepadTouch}}. +
    8. Let |touch:GamepadTouch| be a {{GamepadTouch}}.
    9. -
    10. Set |touchEvent|.{{GamepadTouch/surfaceId}} to be - |surfaceId|. +
    11. Set |touch|.{{GamepadTouch/surfaceId}} to be |surfaceId|.
    12. If the touch data is part of an existing active touch point tracked by the user agent:
        -
      1. Set |touchEvent|.{{GamepadTouch/touchId}} to the - touchId of the active touch point. +
      2. Set |touch|.{{GamepadTouch/touchId}} to the touchId + of the active touch point.
      3. Otherwise, set touchId to nextTouchId and increment nextTouchId. @@ -731,48 +723,28 @@

    13. -
    14. Let |position| be a [=new=] {{Float32Array}} with length - 2. +
    15. Let |position| be a [=new=] {{DOMPoint}} with `x` + initialized to device X coordinate relative to the device + touch surface and normalized to [-1.0,1.0] where -1.0 is the + leftmost coordinate and 1.0 is the rightmost coordinate and + `y` initialized to the device touch surface and normalized to + [-1.0,1.0] where -1.0 is the leftmost coordinate and 1.0 is + the rightmost coordinate.
    16. -
    17. -

      - |position|[0] should be set to the device X coordinate - relative to the device touch surface and normalized to - [-1.0,1.0] where -1.0 is the leftmost coordinate and 1.0 - is the rightmost coordinate. -

      -

      - `position[0] = (2.0 * touchData.x / surfaceDimensions[0]) - - 1` -

      -
    18. -
    19. -

      - |position|[1] should be set to the device Y coordinate - relative to the device touch surface and normalized to - [-1.0,1.0] where -1.0 is the topmost coordinate and 1.0 - is the bottommost coordinate. -

      -

      - `position[1] = (2.0 * touchData.y / surfaceDimensions[1]) - - 1` -

      +

      + `x = (2.0 * touchData.x / surfaceDimensions.width) - 1` +

      +

      + `y = (2.0 * touchData.y / surfaceDimensions.height) - 1` +

      +
    20. Add |touch| to {{Gamepad}}.{{Gamepad/[[touches]]}}.
  6. -
  7. Set |touchEvent|.{{GamepadTouch/position}} to be - |position:Float32Array|. -
  8. -
  9. Add |touchEvent| to {{Gamepad}}.{{Gamepad/[[touches]]}}. -
-
  • Increment |surfaceId| -
  • -
  • Increment |surfaceId| -
  • @@ -1214,18 +1186,19 @@

    position
    - x, y coordinates of the touch event. Range of each coordinate is - normalized to [-1.0, 1.0]. Along the x-axis, -1.0 references the + A {{DOMPoint}} which holds the x, y coordinates of the touch event. + The z and w value are currently unused. The range of each coordinate + is normalized to [-1.0, 1.0]. Along the x-axis, -1.0 references the leftmost coordinate and 1.0 references the rightmost coordinate. Along the y-axis, -1.0 references the topmost coordinate and 1.0 - references the bottommost coordinate. MUST be a two-element array. + references the bottommost coordinate.
    surfaceDimensions
    - Width and height of the touch surface in integer units. When not - null, MUST be a two-element array. + A {{DOMRect}} initialized with the width and height of the touch + surface in integer units. If not available then null.