-
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:
|
b756fd4
to
8ec7959
Compare
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?
`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.
<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.
</p> | ||
<pre class="idl"> | ||
[Exposed=Window, SecureContext] | ||
interface 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.
interface GamepadTouch { | |
dictionary GamepadTouch { |
<pre class="idl"> | ||
[Exposed=Window, SecureContext] | ||
interface GamepadTouch { | ||
readonly attribute unsigned long touchId; |
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 unsigned long touchId; | |
unsigned long touchId; |
[Exposed=Window, SecureContext] | ||
interface GamepadTouch { | ||
readonly attribute unsigned long touchId; | ||
readonly attribute octet 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.
readonly attribute octet surfaceId; | |
octet surfaceId; |
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
|
`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
"touch surface enumeration order" "active touch point"
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.
The {{Gamepad/touches}} getter steps are: | ||
</p> | ||
<ol> | ||
<li>If [=this=].{{Gamepad/[[touches]]}} not `null` and not empty, |
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>If [=this=].{{Gamepad/[[touches]]}} not `null` and not empty, | |
<li>If [=this=].{{Gamepad/[[touches]]}} is not `null` and not empty, |
</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 |
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.
<li>If [=this=].{{Gamepad/[[touches]]}} not `null` and not empty, | ||
return [=this=].{{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.
Change this to return whatever is in the internal slot.
@@ -644,6 +678,102 @@ <h3> | |||
</ol> | |||
</li> | |||
</ol> | |||
<p> | |||
To <dfn>update touches</dfn> for |gamepad:Gamepad|, run the following |
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>update touches</dfn> for |gamepad:Gamepad|, run the following | |
To <dfn>refresh touches</dfn> for |gamepad:Gamepad|, run the following |
<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]]}}. |
<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.
<li>Repeat the following steps for each active touch point | ||
reported by the |gamepad| for the current touch surface. | ||
<ol> | ||
<li>Let |nextTouchId:unsigned long| be the next available |
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.
You might want to increment the id on each loop.
<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 |
</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
@@ -676,6 +806,9 @@ <h3> | |||
<li>Initialize |gamepad|.{{Gamepad/[[buttons]]}} to the result of | |||
[=initializing buttons=] for |gamepad|. | |||
</li> | |||
<li>Initialize |gamepad|.{{Gamepad/[[touches]]}} to the result of | |||
[=initializing 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.
Instead, of putting the result at the end, let's just increment as we go but we need to make sure the this is locked thread safe.
<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?
@@ -884,6 +1017,18 @@ <h3> | |||
<li>Return |buttons|. | |||
</li> | |||
</ol> | |||
<p> | |||
To <dfn data-lt="initializing touches">initialize touches</dfn> for 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.
We problem don't need this initializer anymore, as the initial sequence is empty.
readonly attribute DOMPoint position; | ||
readonly attribute DOMRect? 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 DOMPoint position; | |
readonly attribute DOMRect? surfaceDimensions; | |
DOMPoint position; | |
DOMRect? surfaceDimensions; |
input medium is no longer making contact with the touch device. | ||
</p> | ||
<pre class="idl" data-cite="geometry-1"> | ||
[Exposed=Window, SecureContext] |
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.
[Exposed=Window, SecureContext] |
@@ -153,6 +153,7 @@ <h2> | |||
readonly attribute GamepadMappingType mapping; | |||
readonly attribute FrozenArray<double> axes; | |||
readonly attribute FrozenArray<GamepadButton> buttons; | |||
readonly attribute FrozenArray<GamepadTouch>? 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.
nit: Remove since it won't be nullable?
readonly attribute FrozenArray<GamepadTouch>? touches; | |
readonly attribute FrozenArray<GamepadTouch> touches; |
Partially Closes #165
The following tasks have been completed:
Implementation commitment:
Standards positions:
Resources:
Preview | Diff