Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fold touchEvents from extensions.html into index.html #198

Open
wants to merge 7 commits into
base: gh-pages
Choose a base branch
from

Conversation

bradleyneedham
Copy link
Contributor

@bradleyneedham bradleyneedham commented Apr 9, 2024

@bradleyneedham
Copy link
Contributor Author

bradleyneedham commented Apr 9, 2024

I believe the failure of the tidy action is an indentation error on line 19 of .github/workflows/tidy.yml. The with needs to be even with the start of uses.
Current is:

line 18:             - uses:
line 19:             with:

Should be:

line 18:             - uses:
line 19:               with:

@bradleyneedham bradleyneedham force-pushed the issue-165-fold-touchEvents-into-main-spec branch from b756fd4 to 8ec7959 Compare April 12, 2024 00:18
@bradleyneedham bradleyneedham force-pushed the issue-165-fold-touchEvents-into-main-spec branch from 8ec7959 to a4649ca Compare April 12, 2024 00:42
@bradleyneedham
Copy link
Contributor Author

I am moving this from "Draft". Any help with spotting the reason for the validate failure is appreciated.

Also I think that newline: LF should be added to the tidyconfig.txt to prevent local runs of tidy on windows from adding all CRLF.

@bradleyneedham bradleyneedham marked this pull request as ready for review April 12, 2024 00:58
@marcoscaceres
Copy link
Member

@bradleyneedham, sorry, I just need to double check if this is in scope of the Working Group. I seem to recall there was some concerns from some members around anything "touch" related, so just need to make sure it's all fine.

Shouldn't be too long!

@@ -2238,6 +2451,24 @@ <h2>
</p>
</div>
</section>
<section>
<h3>
Glossary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should really be part of a Model section... or wherever the general idea of gamepad is defined.

index.html Outdated
Glossary
</h3>
<p>
<dfn>touch surface</dfn> is a surface that can detect contact from a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<dfn>touch surface</dfn> is a surface that can detect contact from a
<dfn data-dfn-for="gamepad">touch surface</dfn> is a surface that can detect contact from a

index.html Outdated
users fingers and report where on the surface the contact is made.
</p>
<p>
<dfn>touch surface enumeration order</dfn> is an ordered listing of all
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<dfn>touch surface enumeration order</dfn> is an ordered listing of all
<dfn data-dfn-for="gamepad">touch surface enumeration order</dfn> is an ordered listing of all

the surfaces in a |gamepad|.
</p>
<p>
<dfn>active touch point</dfn> is defined in the <a href=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a concept we can maybe use from Pointer Events instead?

index.html Outdated
`null`
</td>
<td>
List of generated touch events.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so... are these really touch "events"? If we look at GamepadTouch, it's not an "Event" at all, so this is a misnomer.

They are more like snapshots of touch points.

index.html Outdated
@@ -460,6 +472,26 @@ <h2>
</li>
</ol>
</dd>
<dt>
<dfn>touchEvents</dfn>
Copy link
Member

@marcoscaceres marcoscaceres May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above... I think it's incorrect to call these "touch events". They are activation points on the track pad at some specific moment in time.

<ol class="algorithm">
<li>Let |surfaceId:unsigned long| be 0.
</li>
<li>Remove any existing events from
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to assume the gamepad is a live object? I don't think this correct. Each gamepad object is just a snapshot in time.

index.html Outdated
[Exposed=Window, SecureContext]
interface GamepadTouch {
readonly attribute unsigned long touchId;
readonly attribute octet surfaceId;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems confusing... wouldn't it be better is gamepad had an unordered touch surface map with named surfaces? Could that be a thing?

const trackpad = gamepad.touchSufaces.get("trackpad"); 

index.html Outdated
</p>
<pre class="idl">
[Exposed=Window, SecureContext]
interface GamepadTouch {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interface GamepadTouch {
dictionary GamepadTouch {

index.html Outdated
<pre class="idl">
[Exposed=Window, SecureContext]
interface GamepadTouch {
readonly attribute unsigned long touchId;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
readonly attribute unsigned long touchId;
unsigned long touchId;

index.html Outdated
[Exposed=Window, SecureContext]
interface GamepadTouch {
readonly attribute unsigned long touchId;
readonly attribute octet surfaceId;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
readonly attribute octet surfaceId;
octet surfaceId;

index.html Outdated
Comment on lines 1188 to 1189
readonly attribute Float32Array position;
readonly attribute Uint32Array? surfaceDimensions;
Copy link
Member

@marcoscaceres marcoscaceres Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
readonly attribute Float32Array position;
readonly attribute Uint32Array? surfaceDimensions;
Float32Array position;
Uint32Array surfaceDimensions;

index.html Outdated
@@ -153,6 +153,7 @@ <h2>
readonly attribute GamepadMappingType mapping;
readonly attribute FrozenArray&lt;double&gt; axes;
readonly attribute FrozenArray&lt;GamepadButton&gt; buttons;
readonly attribute FrozenArray&lt;GamepadTouch&gt;? touchEvents;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
readonly attribute FrozenArray&lt;GamepadTouch&gt;? touchEvents;
readonly attribute FrozenArray&lt;GamepadTouch&gt;? touches;

@bradleyneedham
Copy link
Contributor Author

Just getting to back to this and wanted to verify our discussion at the last meeting.
In general is the following the suggested approach?

        dictionary GamepadTouch {
          unsigned long touchId;
          Float32Array position;
        };

        dictionary GamepadSurface {
          octet surfaceId;
          FrozenArray&lt;GamepadTouch&gt;? touches;
          Uint32Array surfaceDimensions;
        };

        interface Gamepad {
...
          readonly attribute FrozenArray&lt;GamepadSurface&gt;? surfaces;
...
        };

@nondebug
Copy link
Collaborator

If I remember correctly, we decided on maplike interfaces for the surfaceId -> GamepadSurface and touchId -> sequence<GamepadTouch> maps. I think it should look something like this:

        dictionary GamepadTouch {
          Float32Array position;
        };

        interface GamepadTouchMap {
          readonly maplike<unsigned long, sequence<GamepadTouch>>;
        };

        dictionary GamepadSurface {
          GamepadTouchMap touches;
          Uint32Array surfaceDimensions;
        };

        interface GamepadSurfaceMap {
          readonly maplike<octet, GamepadSurface>;
        };

        interface Gamepad {
...
          readonly attribute GamepadSurfaceMap surfaces;
...
        };

index.html Outdated
`null`
</td>
<td>
List of generated touch events.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
List of generated touch events.
List of touches.

@bradleyneedham bradleyneedham force-pushed the issue-165-fold-touchEvents-into-main-spec branch from 926ef0f to 0d65b74 Compare September 23, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fold extensions.html into main spec
3 participants