-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add a gesture to open up a context menu; fix quitting #144
Conversation
A better version of this gesture would include head pose. I think the original suggested gesture was "looking at the palm of your hand", perhaps with the hand pointing upwards. |
webxr/openxr/input.rs
Outdated
InputFrame, | ||
/* clicked */ Option<SelectEvent>, | ||
/* squeezed */ Option<SelectEvent>, | ||
/* menu_selected */ bool, |
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.
Returning a real structure with named fields might be useful at this point.
webxr/openxr/input.rs
Outdated
let mut menu_selected = false; | ||
// Check if the palm is facing up. This is our "menu" gesture. | ||
if let Some(grip_origin) = grip_origin { | ||
// The X axis of the grip is perpendicular to the palm, however it's |
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: its
webxr/openxr/input.rs
Outdated
-1.0 | ||
}; | ||
|
||
// Rotate it by the grip to btain the desired vector |
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: obtain
webxr/openxr/input.rs
Outdated
// close to 1 | ||
if angle > 0.9 { | ||
self.menu_gesture_sustain += 1; | ||
if self.menu_gesture_sustain > 60 { |
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.
Should we make this a named constant?
webxr/openxr/mod.rs
Outdated
@@ -65,19 +65,58 @@ pub trait SurfaceProviderRegistration: Send { | |||
fn clone(&self) -> Box<dyn SurfaceProviderRegistration>; | |||
} | |||
|
|||
/// |
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.
/// Provides a way to interact with context menus.
1bec1a8
to
20408f2
Compare
@bors-servo r=jdm |
📌 Commit 20408f2 has been approved by |
Add a gesture to open up a context menu; fix quitting This adds a gesture (currently: "palm facing upwards") to open up a context menu. servo side: servo/servo#26051 r? @jdm
💔 Test failed - checks-travis |
20408f2
to
1557ec4
Compare
@bors-servo r=jdm |
📌 Commit 1557ec4 has been approved by |
Add a gesture to open up a context menu; fix quitting This adds a gesture (currently: "palm facing upwards") to open up a context menu. servo side: servo/servo#26051 r? @jdm
1557ec4
to
8a53399
Compare
@bors-servo r=jdm |
📌 Commit 8a53399 has been approved by |
☀️ Test successful - checks-travis |
Hook up new openxr context menu gesture to embedder context menu machinery Based on #26043 Fixes #25797, #26057 servo/webxr#144 needs to land first Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it. r? @jdm cc @paulrouget
Hook up new openxr context menu gesture to embedder context menu machinery Based on #26043 Fixes #25797, #26057 servo/webxr#144 needs to land first Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it. r? @jdm cc @paulrouget
Hook up new openxr context menu gesture to embedder context menu machinery Based on #26043 Fixes #25797, #26057 servo/webxr#144 needs to land first Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it. r? @jdm cc @paulrouget
Hook up new openxr context menu gesture to embedder context menu machinery Based on #26043 Fixes #25797, #26057 servo/webxr#144 needs to land first Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it. r? @jdm cc @paulrouget
Hook up new openxr context menu gesture to embedder context menu machinery Based on #26043 Fixes #25797, #26057 servo/webxr#144 needs to land first Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it. r? @jdm cc @paulrouget
Hook up new openxr context menu gesture to embedder context menu machinery Based on #26043 Fixes #25797, #26057 servo/webxr#144 needs to land first Currently when exited the Servo window is blurred, apparently we need to call `Window.Activate` on it. r? @jdm cc @paulrouget
This adds a gesture (currently: "palm facing upwards") to open up a context menu.
servo side: servo/servo#26051
r? @jdm