-
Notifications
You must be signed in to change notification settings - Fork 48
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
base: gh-pages
Are you sure you want to change the base?
Fold touchEvents from extensions.html into index.html #198
Conversation
I believe the failure of the
Should be:
|
8ec7959
to
a4649ca
Compare
I am moving this from "Draft". Any help with spotting the reason for the validate failure is appreciated. Also I think that |
@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! |
index.html
Outdated
@@ -2238,6 +2451,24 @@ <h2> | |||
</p> | |||
</div> | |||
</section> | |||
<section> | |||
<h3> | |||
Glossary |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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 |
index.html
Outdated
the surfaces in a |gamepad|. | ||
</p> | ||
<p> | ||
<dfn>active touch point</dfn> is defined in the <a href= |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
index.html
Outdated
<ol class="algorithm"> | ||
<li>Let |surfaceId:unsigned long| be 0. | ||
</li> | ||
<li>Remove any existing events from |
There was a problem hiding this comment.
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
readonly attribute Float32Array position; | ||
readonly attribute Uint32Array? surfaceDimensions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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<double> axes; | |||
readonly attribute FrozenArray<GamepadButton> buttons; | |||
readonly attribute FrozenArray<GamepadTouch>? touchEvents; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
readonly attribute FrozenArray<GamepadTouch>? touchEvents; | |
readonly attribute FrozenArray<GamepadTouch>? touches; |
Just getting to back to this and wanted to verify our discussion at the last meeting.
|
If I remember correctly, we decided on maplike interfaces for the
|
index.html
Outdated
`null` | ||
</td> | ||
<td> | ||
List of generated touch events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List of generated touch events. | |
A [=list=] of touch that are represented as {{GamepadTouch}}s. The ordering is hardware or platform specific. |
926ef0f
to
0d65b74
Compare
c3160a0
to
436b0c1
Compare
A list of all the {{GamepadHapticActuator}}s in the gamepad. The same object | ||
MUST be returned until the user agent needs to return different | ||
values (or values in a different order). | ||
A list of all the {{GamepadHapticActuator}}s in the gamepad. The same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this is an optimization... as you say, this can't be assured.
index.html
Outdated
</dt> | ||
<dd> | ||
<p> | ||
A list of {{GamepadTouch}} events generated from all touch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A list of {{GamepadTouch}} events generated from all touch | |
A [=list=] of {{GamepadTouch}} generated from all touch |
index.html
Outdated
surfaces. If the device does not support touch events, MUST be set | ||
to `null`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make it empty.
index.html
Outdated
<li>Remove any existing events from | ||
{{Gamepad}}.{{Gamepad/[[touches]]}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<li>Remove any existing events from | |
{{Gamepad}}.{{Gamepad/[[touches]]}}. | |
<li>[=List/empty=] {{Gamepad}}.{{Gamepad/[[touches]]}}. |
index.html
Outdated
<li>Set |touchEvent|.{{GamepadTouch/surfaceDimensions}}[0] to | ||
the maximum X dimension on the touch surface in device units. | ||
</li> | ||
<li>Set |touchEvent|.{{GamepadTouch/surfaceDimensions}}[1] to | ||
the maximum Y dimension on the touch surface in device units. | ||
</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use DOMRect/point terminology.
index.html
Outdated
<li>If the touch surface exposes maximum surface dimensions in | ||
device units: | ||
<ol> | ||
<li>Set |touchEvent|.{{GamepadTouch/surfaceDimensions}}[0] to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, move away from calling it "*Event". Call it |gameTouch|, and
<li>Set |touchEvent|.{{GamepadTouch/surfaceDimensions}}[0] to | |
<li>Let |gamepadTouch| be a newly created {{GamepadTouch}.</li> | |
<li>Set |gamepadTouch|.{{GamepadTouch/surfaceDimensions}}[0] to |
index.html
Outdated
</li> | ||
</ol> | ||
</li> | ||
<li>Increment |surfaceId| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, increment twice
<li>Maintaining the uniqueness of the id per origin to prevent | ||
fingerprinting. | ||
</li> | ||
</ul>{{GamepadTouch/touchId}} SHOULD be set to a default value of 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using 0
here, should we store a touchId
counter in an internal slot somewhere? Maybe in the target Gamepad
object?
"touch surface enumeration order" "active touch point"
141c3a2
to
4a85ea0
Compare
The {{Gamepad/touches}} getter steps are: | ||
</p> | ||
<ol> | ||
<li>Return whatever is in the internal slot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<li>Return whatever is in the internal slot. | |
<li>Return the [=list=] of the {{Gamepad/[[touches]]} internal slot. |
<dfn data-dfn-for="Gamepad">[[\touches]]</dfn> | ||
</td> | ||
<td> | ||
An empty [=list=] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An empty [=list=] | |
Initialize to an [=list/empty=] [=list=] |
An empty [=list=] | ||
</td> | ||
<td> | ||
List of generated touches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List of generated touches. | |
Holds the list of user-generated touches, if any. If the gamepad does not support touch surfaces, then the list will remain empty. |
surfaces. If the device does not support touches, then an empty | ||
[=list=]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surfaces. If the device does not support touches, then an empty | |
[=list=]. | |
surfaces. |
@@ -507,6 +536,8 @@ <h3> | |||
</li> | |||
<li>Run the steps to [=map and normalize buttons=] for |gamepad|. | |||
</li> | |||
<li>Run the steps to [=refresh touches=] for |gamepad|. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<li>Run the steps to [=refresh touches=] for |gamepad|. | |
<li>Run the steps to [=record touches=] for |gamepad|. |
@@ -644,6 +675,74 @@ <h3> | |||
</ol> | |||
</li> | |||
</ol> | |||
<p> | |||
To <dfn>refresh touches</dfn> for |gamepad:Gamepad|, run the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To <dfn>refresh touches</dfn> for |gamepad:Gamepad|, run the | |
To <dfn>record touches</dfn> for |gamepad:Gamepad|, run the |
<li>Remove any existing objects from | ||
{{Gamepad}}.{{Gamepad/[[touches]]}}. | ||
</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<li>Remove any existing objects from | |
{{Gamepad}}.{{Gamepad/[[touches]]}}. | |
</li> | |
<li>Assert: {{Gamepad}}.{{Gamepad/[[touches]]}} is [=list/empty=]. | |
</li> |
<li>Let |nextTouchId:unsigned long| be the next available | ||
touchId for the |gamepad|. | ||
</li> | ||
<li>Let |touch:GamepadTouch| be a {{GamepadTouch}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<li>Let |touch:GamepadTouch| be a {{GamepadTouch}}. | |
<li>Let |touch:GamepadTouch| be a newly created {{GamepadTouch}} object. |
Partially Closes #165
The following tasks have been completed:
Implementation commitment:
Standards positions:
Resources:
Preview | Diff