Re: [w3c/gamepad] Add a model section (PR #220)

@gabrielsanbrito commented on this pull request.

@nondebug left a couple of comments. I think that the model section looks good!

> +        The [=user agent=] is responsible for enumerating [=available=]
+        [=gamepads=], detecting when [=gamepads=] become [=available=] or
+        [=unavailable=], and detecting when input controls have updated input
+        values.

Maybe make this a bullet list?

> @@ -136,6 +136,164 @@ <h2>
         sensing, depth sensing, video analysis, gesture recognition, and so on.
       </p>
     </section>
+    <section>
+      <h2>
+        Model
+      </h2>
+      <p>
+        A <dfn>gamepad</dfn> is a collection of input controls (buttons,

```suggestion
        A <dfn>gamepad</dfn> is a collection of <dfn>input controls</dfn> (buttons,
```
Maybe we should also add a definition for "input controls"?

> +        [=gamepad=] is [=available=]. Each input control has one or more
+        <dfn>input values</dfn> that may update over time.
+      </p>
+      <p>
+        The [=user agent=] is responsible for enumerating [=available=]
+        [=gamepads=], detecting when [=gamepads=] become [=available=] or
+        [=unavailable=], and detecting when input controls have updated input
+        values.
+      </p>
+      <p>
+        A [=gamepad=] has a <dfn>gamepad identifier string</dfn>, a
+        human-readable string that identifies the brand or style of
+        [=gamepad=]. The content is decided by the [=user agent=].
+      </p>
+      <p>
+        A [=gamepad=] may be a physical device. If so, it has an <dfn>input

Can a gamepad be something other than a physical device in the context of this spec? If so, maybe we can exemplify which types of non-physical devices a gamepad object can represent?

> +        layout</dfn>, meaning the relative positions and orientations of its
+        input controls are close enough to the standard layout that a user can
+        use it interchangeably with other devices that have the same input
+        controls and correspond with the same layout.

I think that this clause is a little confusing. This part to be more specific: "that a user can use it interchangeably with other devices that have the same input controls and correspond with the same layout". 

I think that adding "standard" at the end makes things clearer?
```suggestion
        layout</dfn>, meaning the relative positions and orientations of its
        input controls are close enough to a standard layout that a user can
        use it interchangeably with other devices that have the same input
        controls and correspond with the same standard layout.
```

> +        control. If so, the [=axis=] has a <dfn>preferred axis state</dfn>. An
+        An [=axis=] with a [=preferred axis state=] may also have a <dfn>center
+        position value</dfn> [=input value=] which is the [=logical axis
+        value=] when the [=axis=] is centered.

Remove double "An" and maybe we remove the `[=input value=]` reference to make the text more fluid? Or maybe we can have `<dfn>center position input value</dfn>`?
```suggestion
        control. If so, the [=axis=] has a <dfn>preferred axis state</dfn>. An
        [=axis=] with a [=preferred axis state=] may also have a <dfn>center
        position value</dfn> which is the [=logical axis
        value=] when the [=axis=] is centered.
```

> +        A [=touch surface=] has an <dfn>active touch point list</dfn> [=input
+        value=], a [=list=] of zero or more [=touch points=] representing the

```suggestion
        A [=touch surface=] has an <dfn>active touch point list</dfn> of [=input
        values=], a [=list=] of zero or more [=touch points=] representing the
```

> +        A [=gamepad=] may have [=touch surfaces=]. A <dfn>touch surface</dfn>
+        is an input control that provides 2D position data representing points
+        of contact. A [=gamepad=] has a <dfn>touch surface list</dfn> which is

Is it relevant to mention that the we are using a cartesian system to locate these touch points?
```suggestion
        A [=gamepad=] may have [=touch surfaces=]. A <dfn>touch surface</dfn>
        is an input control that provides 2D position data representing points
        of contact in a cartesian coordinate system, where the origin is located in the
        center of the touch surface. A [=gamepad=] has a <dfn>touch surface list</dfn> which is
```

> +      <p>
+        A [=gamepad=] may have [=touch surfaces=]. A <dfn>touch surface</dfn>
+        is an input control that provides 2D position data representing points
+        of contact. A [=gamepad=] has a <dfn>touch surface list</dfn> which is
+        a [=list=] containing the [=touch surfaces=] for the [=gamepad=]. The
+        list is ordered such that [=touch surfaces=] closer to the left side of
+        the [=gamepad=] appear closer to the start of the list.
+      </p>
+      <p>
+        A [=touch surface=] has an <dfn>active touch point list</dfn> [=input
+        value=], a [=list=] of zero or more [=touch points=] representing the
+        points of contact currently detected by the sensor, ordered such that
+        earlier [=touch points=] appear closer to the start of the [=list=]. A
+        <dfn>touch point</dfn> represents a single point of contact at a single
+        point in time. A [=touch point=] has a <dfn>touch x coordinate</dfn>
+        representing its position along the user's left-right axis and a

Maybe "horizontal" is more formal?
```suggestion
        representing its position along the user's horizontal axis and a
```

> +        list is ordered such that [=touch surfaces=] closer to the left side of
+        the [=gamepad=] appear closer to the start of the list.
+      </p>
+      <p>
+        A [=touch surface=] has an <dfn>active touch point list</dfn> [=input
+        value=], a [=list=] of zero or more [=touch points=] representing the
+        points of contact currently detected by the sensor, ordered such that
+        earlier [=touch points=] appear closer to the start of the [=list=]. A
+        <dfn>touch point</dfn> represents a single point of contact at a single
+        point in time. A [=touch point=] has a <dfn>touch x coordinate</dfn>
+        representing its position along the user's left-right axis and a
+        <dfn>touch y coordinate</dfn> representing its position along the
+        perpendicular axis.
+      </p>
+      <p>
+        A [=touch surface=] may have surface dimension [=input values=]. The

Are the surface dimensions considered `input values`? According to our definition, `input values` are associated with `input controls`. Maybe we could just say that dimensions are just "values"?

> +        {{GamepadTouch}}. The <dfn>active touch point id</dfn> for a [=touch
+        point=] is the {{GamepadTouch/touchId}} of the earlier
+        {{GamepadTouch}}.

```suggestion
        {{GamepadTouch}}. The <dfn>active touch point id</dfn> for a [=touch
        point=] that is [=part of an existing active touch point=] is the
        {{GamepadTouch/touchId}} of the earlier {{GamepadTouch}}.
```
Or maybe:
```suggestion
        {{GamepadTouch}}. In this case, the [=touch point=]'s {{GamepadTouch/touchId}} is the 
        {{GamepadTouch/touchId}} of the earlier {{GamepadTouch}}.
```

> +        A [=gamepad=] may have [=haptic actuators=]. A <dfn>haptic
+        actuator</dfn> is an output control capable of moving the [=gamepad=]
+        in a way that can be felt by the user. A <dfn>haptic effect</dfn> is
+        the use of one or more [=haptic actuators=] to provide feedback to the
+        user. The [=user agent=] is responsible for commanding [=haptic
+        actuators=] to play and stop [=haptic effects=] on [=available=]
+        [=gamepads=].

Maybe this way?
```suggestion
        A [=gamepad=] may have [=haptic actuators=]. A <dfn>haptic
        actuator</dfn> is an output control capable of moving the [=gamepad=]
        in a way that can be felt by the user. One or more [=Haptic actuators=]
        can be used to generate <dfn>haptic effects</dfn> and provide feedback to the
        user. The [=user agent=] is responsible for commanding [=haptic
        actuators=] to play and stop [=haptic effects=] on [=available=]
        [=gamepads=].
```

> @@ -136,6 +136,164 @@ <h2>
         sensing, depth sensing, video analysis, gesture recognition, and so on.
       </p>
     </section>
+    <section>
+      <h2>
+        Model
+      </h2>

Maybe we can create a subdivide this section in:
- Model 
  - input controls
    - axes
    - buttons
    - touch 
  - output controls

In the Model's section caput we can define the gamepad's properties (basically the first 4 paragraphs) and then we can go into the controls' subsections. WDYT of something like this?
```
//Model
A gamepad is a collection of input controls...
[...]
... and correspond with the same layout.

A [=gamepad=] may have input controls:
- Axis inputs
- button inputs
- touch surfaces

A [=gamepad=] may have output controls like haptic actuators.

// // Input controls
[...]
// // Output controls
```

> +        control. If so, the [=axis=] has a <dfn>preferred axis state</dfn>. An
+        An [=axis=] with a [=preferred axis state=] may also have a <dfn>center
+        position value</dfn> [=input value=] which is the [=logical axis
+        value=] when the [=axis=] is centered.

This same feedback also applies to `<dfn>digital button value</dfn>` and `dfn>button touch value</dfn>`.

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

Message ID: <w3c/gamepad/pull/220/review/2782680259@github.com>

Received on Tuesday, 22 April 2025 04:53:23 UTC