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

Define squeeze events #893

Merged
merged 6 commits into from
Oct 28, 2019
Merged

Conversation

Manishearth
Copy link
Contributor

@Manishearth Manishearth commented Oct 21, 2019

/fixes #876

This adds an optional "primary squeeze" mirroring the "primary action". Once this lands we can backreference it from the gamepads module.

This also cleans up the primary action spec text to make the primary action a requirement.

cc @thetuvix

attribute EventHandler onselectstart;
attribute EventHandler onselectend;
attribute EventHandler onsqueeze;
attribute EventHandler onsqueezestart;
attribute EventHandler onsqueezeend;
Copy link
Member

Choose a reason for hiding this comment

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

Not an actual issue, but reading onsqueezeend hurts my brain. It sounds like an imaginary verb conjugation my kids would make up. "I squeezend the balloon real hard, and it popped!" 😆

Copy link

Choose a reason for hiding this comment

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

it will also be hard for non-native developers to write. Especially without the aid of camelcase or similar.

Copy link
Member

Choose a reason for hiding this comment

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

I agree they're hard to read. Unfortunately, IIRC, this casing convention isn't one our WG decided on; we're just following the general web platform guidance. Given that, I'm not sure what else can be done...

@@ -1505,6 +1515,8 @@ Note: {{XRInputSource}}s in an {{XRSession}}'s {{XRSession/inputSources}} array

Each [=XR input source=] SHOULD define a <dfn>primary action</dfn>. The [=primary action=] is a platform-specific action that, when engaged, produces {{XRSession/selectstart}}, {{XRSession/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.

Load bearing whitespace?

index.bs Outdated
@@ -1526,6 +1538,29 @@ When an [=XR input source=] |source| for {{XRSession}} |session| ends its [=prim

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 [=XRSession/XR device=] after the [=primary action=] is started but before it ends.

Each [=XR input source=] MAY define a <dfn>primary squeeze</dfn>. The [=primary squeeze=] is a platform-specific action that, when engaged, produces {{XRSession/squeezestart}}, {{XRSession/squeezeend}}, and {{XRSession/squeeze}} events. The [=primary squeeze=] should be used for actions rougly mapping to squeezing or grabbing. Examples of possible [=primary squeeze=]s are pressing a grip trigger or making a grabbing hand gesture. If the platform guidelines define a recommended primary squeeze then it should be used as the [=primary squeeze=], 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.

Again... this verbiage is making me laugh. I promise I'll get over it (or at least stop making dumb review comments about it) after this review is over.

"Main squeeze" ("most important person") is attested from 1896, the specific meaning "one's sweetheart, lover" is attested by 1980.

ae4eb483c182c549516df5c2b851de5e - Edited
s/Hammer/Controller

Copy link
Member

Choose a reason for hiding this comment

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

Real feedback: Maybe "primary squeeze action" or simply "squeeze action" would read better here. We may possibly also want to retcon "primary action" into "select action".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh don't worry i have been finding the terminology "primary squeeze" hilarious as well, but i'm not too worried about it.

the retcon seems fine, though this may require further edits to the gamepad module as well as the input profiles repo for that. "primary squeeze action" seems okay though, i'll make that change

@Manishearth
Copy link
Contributor Author

Addressed

Copy link
Member

@toji toji left a comment

Choose a reason for hiding this comment

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

LGTM! ✊ (<-- Squeeze emoji)

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.

Mostly LGTM. A few smallish comments and one notable question.

index.bs Outdated Show resolved Hide resolved
attribute EventHandler onselectstart;
attribute EventHandler onselectend;
attribute EventHandler onsqueeze;
attribute EventHandler onsqueezestart;
attribute EventHandler onsqueezeend;
Copy link
Member

Choose a reason for hiding this comment

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

I agree they're hard to read. Unfortunately, IIRC, this casing convention isn't one our WG decided on; we're just following the general web platform guidance. Given that, I'm not sure what else can be done...

index.bs Outdated
@@ -1526,6 +1536,29 @@ When an [=XR input source=] |source| for {{XRSession}} |session| ends its [=prim

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 [=XRSession/XR device=] after the [=primary action=] is started but before it ends.

Each [=XR input source=] MAY define a <dfn>primary squeeze action</dfn>. The [=primary squeeze action=] is a platform-specific action that, when engaged, produces {{XRSession/squeezestart}}, {{XRSession/squeezeend}}, and {{XRSession/squeeze}} events. The [=primary squeeze action=] should be used for actions rougly mapping to squeezing or grabbing. Examples of possible [=primary squeeze action=]s are pressing a grip trigger or making a grabbing hand gesture. If the platform guidelines define a recommended primary squeeze action then it should be used as the [=primary squeeze 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.

Each [=XR input source=] MAY define

Why is this event "MAY" and the other "SHOULD"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We require a primary action, but I don't think we need to require a primary squeeze action.

Copy link
Member

Choose a reason for hiding this comment

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

Does that mean the trigger action should be MUST?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. Come to think of it, I thought it already was MUST somewhere in the spec. I don't mind changing it here, given that we're kinda requiring this in the gamepads spec.

index.bs Outdated
@@ -1526,6 +1536,29 @@ When an [=XR input source=] |source| for {{XRSession}} |session| ends its [=prim

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 [=XRSession/XR device=] after the [=primary action=] is started but before it ends.

Each [=XR input source=] MAY define a <dfn>primary squeeze action</dfn>. The [=primary squeeze action=] is a platform-specific action that, when engaged, produces {{XRSession/squeezestart}}, {{XRSession/squeezeend}}, and {{XRSession/squeeze}} events. The [=primary squeeze action=] should be used for actions rougly mapping to squeezing or grabbing. Examples of possible [=primary squeeze action=]s are pressing a grip trigger or making a grabbing hand gesture. If the platform guidelines define a recommended primary squeeze action then it should be used as the [=primary squeeze 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.

If the platform guidelines define a recommended primary squeeze action then it should be used as the [=primary squeeze action=], otherwise the user agent is free to select one.

Is this something that should be defined in the registry so there is consistent behavior for a given profile id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the gamepads module already defines "primary squeeze", i'd like to edit it to point to this once this lands.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Manishearth
Copy link
Contributor Author

r? @thetuvix

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.

One last comment, otherwise LGTM!

index.bs Outdated
@@ -1526,6 +1536,29 @@ When an [=XR input source=] |source| for {{XRSession}} |session| ends its [=prim

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 [=XRSession/XR device=] after the [=primary action=] is started but before it ends.

Each [=XR input source=] MAY define a <dfn>primary squeeze action</dfn>. The [=primary squeeze action=] is a platform-specific action that, when engaged, produces {{XRSession/squeezestart}}, {{XRSession/squeezeend}}, and {{XRSession/squeeze}} events. The [=primary squeeze action=] should be used for actions rougly mapping to squeezing or grabbing. Examples of possible [=primary squeeze action=]s are pressing a grip trigger or making a grabbing hand gesture. If the platform guidelines define a recommended primary squeeze action then it should be used as the [=primary squeeze 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.

Does that mean the trigger action should be MUST?

index.bs Outdated Show resolved Hide resolved
index.bs Outdated
@@ -1526,6 +1536,29 @@ When an [=XR input source=] |source| for {{XRSession}} |session| ends its [=prim

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 [=XRSession/XR device=] after the [=primary action=] is started but before it ends.

Each [=XR input source=] MAY define a <dfn>primary squeeze action</dfn>. The [=primary squeeze action=] is a platform-specific action that, when engaged, produces {{XRSession/squeezestart}}, {{XRSession/squeezeend}}, and {{XRSession/squeeze}} events. The [=primary squeeze action=] should be used for actions rougly mapping to squeezing or grabbing. Examples of possible [=primary squeeze action=]s are pressing a grip trigger or making a grabbing hand gesture. If the platform guidelines define a recommended primary squeeze action then it should be used as the [=primary squeeze action=], otherwise the user agent MAY select one.
Copy link
Contributor

Choose a reason for hiding this comment

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

In the gamepad spec, will we then specify that for "xr-standard", the squeeze action must map to button 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Manishearth Manishearth merged commit 5285b12 into immersive-web:master Oct 28, 2019
@Manishearth Manishearth deleted the squeeze branch October 28, 2019 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose events for a squeeze(grip) action
5 participants