Skip to content

Define event order of input sources #629

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

Merged
merged 4 commits into from
May 14, 2019
Merged

Define event order of input sources #629

merged 4 commits into from
May 14, 2019

Conversation

toji
Copy link
Member

@toji toji commented May 6, 2019

Fixes #540

Defines the order that events fire in during the handling of transient events.

@toji toji added this to the May 2019 milestone May 6, 2019
Copy link
Contributor

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

ah, i was wondering how to handle these when thinking in terms of gesture-input like on the Hololens

Copy link
Member

@NellWaliczek NellWaliczek left a comment

Choose a reason for hiding this comment

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

I'm glad we're getting the event ordering nailed down! I'm not 100% clear why this is unique to transient input sources though?

index.bs Outdated

When a [=transient input source=] for {{XRSession}} |session| begins it's [=primary action=] the UA MUST run the following steps:

1. Fire any <code>"pointerdown"</code> events produced by the [=XR input source=]'s action, if necessary.
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious about why the first two steps are in this order? I don't think I have strong opinion either way I suppose?

Copy link
Member Author

Choose a reason for hiding this comment

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

That was the order that you had in the explainer. I don't recall us having a conversation about it at any point, but I do recall looking at your PR and wondering if it mattered before deciding that it probably did not and thus wasn't worth discussing.

Copy link
Member

Choose a reason for hiding this comment

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

Haha, well I don't think I have a strong opinion either?

@toji
Copy link
Member Author

toji commented May 8, 2019

Regarding why this is for transient sources only: Any of the non-transient input sources I can think of wouldn't be firing interleaved pointer/click events? Also, this is how it was presented in the explainer and the issue in questions (#540) specifically called out that the new explainer text needed to be pulled into the spec.

And yes, that was probably too narrow of a reading of the issue/explainer text on my part. I'll address the feedback soon.

@toji toji force-pushed the transient-input branch from 196f98a to 376757c Compare May 10, 2019 22:40
@toji toji changed the title Define the behavior of transient input sources Define event order of input sources May 10, 2019
@toji
Copy link
Member Author

toji commented May 10, 2019

Updated to address feedback. Big change is section talking about order of events for non-transient input sources. PTAL!

Copy link
Member

@NellWaliczek NellWaliczek left a comment

Choose a reason for hiding this comment

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

It seems like the transient section could probably fairly easily be folded into the main event ordering section, but I don't have a strong opinion on this needing to happen.

Thanks for putting this together!

index.bs Outdated
@@ -1206,16 +1200,46 @@ The <dfn attribute for="XRInputSource">gamepad</dfn> attribute is a {{Gamepad}}
- A button which reports analog values
- An axis

NOTE: {{XRInputSource}}s with a <code>null</code> {{gamepad}} can still fire {{select}}, {{selectstart}}, and {{selectend}} events to report binary inputs.
Each [=XR input source=] SHOULD define a <dfn>primary action</dfn>. The [=primary action=] is a platform-specific action that, when engaged, produces {{selectstart}}, {{selectend}}, and {{XRSession/select}} events. Examples of possible [=primary action=]s are pressing a trigger, touchpad, or button, speaking a command, or making a hand gesture. If the platform guidelines define a recommended primary input then it should be used as the [=primary action=], otherwise the user agent is free to select one.
Copy link
Member

Choose a reason for hiding this comment

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

recommended primary input

This is a bit confusing? Perhaps say "button"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed that it sounds a bit awkward, but I wanted to be inclusive to inputs such as air taps and voice commands.


</div>

Sometimes platform-specific behavior can result in a [=primary action=] being interrupted or cancelled. For example, a [=/XR input source=] may be removed from the [=/XR device=] after the [=primary action=] is started but before it ends.
Copy link
Member

Choose a reason for hiding this comment

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

Are there other reasons for this to occur? If not, perhaps it would make the spec text clearer if we landed a fix for the issue described in this comment #628 (comment) first?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are other reasons, I'm just not sure how many we really want to get into in the spec text? For example: If you started a mouse click on an inline canvas and then moved the cursor off before releasing?

@toji toji force-pushed the transient-input branch from 854d5a8 to b93894e Compare May 14, 2019 05:09
@toji toji changed the base branch from input-list to master May 14, 2019 05:09
@toji toji merged commit af39333 into master May 14, 2019
@toji toji deleted the transient-input branch May 14, 2019 05:14
@AdaRoseCannon AdaRoseCannon added the ed:spec Include in newsletter, spec change label Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ed:spec Include in newsletter, spec change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update spec text to clarify the order in which input events should fire
4 participants