-
Notifications
You must be signed in to change notification settings - Fork 380
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
Conversation
attribute EventHandler onselectstart; | ||
attribute EventHandler onselectend; | ||
attribute EventHandler onsqueeze; | ||
attribute EventHandler onsqueezestart; | ||
attribute EventHandler onsqueezeend; |
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.
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!" 😆
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.
it will also be hard for non-native developers to write. Especially without the aid of camelcase or similar.
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.
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. | |||
|
|||
|
|||
|
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.
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. |
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.
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.
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.
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".
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.
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
Addressed |
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.
LGTM! ✊ (<-- Squeeze emoji)
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.
Mostly LGTM. A few smallish comments and one notable question.
attribute EventHandler onselectstart; | ||
attribute EventHandler onselectend; | ||
attribute EventHandler onsqueeze; | ||
attribute EventHandler onsqueezestart; | ||
attribute EventHandler onsqueezeend; |
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.
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. |
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.
Each [=XR input source=] MAY define
Why is this event "MAY" and the other "SHOULD"?
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 require a primary action, but I don't think we need to require a primary squeeze action.
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.
Does that mean the trigger action should be MUST?
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.
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. |
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.
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?
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.
Yes, the gamepads module already defines "primary squeeze", i'd like to edit it to point to this once this lands.
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.
r? @thetuvix |
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.
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. |
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.
Does that mean the trigger action should be MUST?
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. |
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.
In the gamepad spec, will we then specify that for "xr-standard"
, the squeeze action must map to button 1?
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.
/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