mouse-motion-only handsfree modes
This commit is contained in:
@@ -74,6 +74,8 @@
|
||||
"AUTO_HELP": "ScreenCopy GPU if supported,\notherwise PipeWire GPU.",
|
||||
"EYE_PINCH": "Eye + pinch",
|
||||
"HMD_PINCH": "HMD + pinch",
|
||||
"EYE_ONLY": "Eye only",
|
||||
"HMD_ONLY": "HMD only",
|
||||
"NONE": "None",
|
||||
"PIPEWIRE_HELP": "Fast GPU capture,\nstandard on all desktops.",
|
||||
"PW_FALLBACK_HELP": "Slow method with high CPU usage.\nTry in case PipeWire GPU doesn't work",
|
||||
|
||||
@@ -167,7 +167,9 @@
|
||||
<context_menu >
|
||||
<cell translation="BAR.HANDSFREE.NONE" _press="::HandsfreeMode None" />
|
||||
<cell translation="BAR.HANDSFREE.HMD" _press="::HandsfreeMode Hmd" />
|
||||
<cell translation="BAR.HANDSFREE.HMD_ONLY" _press="::HandsfreeMode HmdOnly" />
|
||||
<cell translation="BAR.HANDSFREE.EYE_TRACKING" _press="::HandsfreeMode EyeTracking" />
|
||||
<cell translation="BAR.HANDSFREE.EYE_ONLY" _press="::HandsfreeMode EyeTrackingOnly" />
|
||||
</context_menu>
|
||||
</blueprint>
|
||||
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
"TITLE": "Handsfree mode",
|
||||
"NONE": "Off",
|
||||
"HMD": "HMD + pinch",
|
||||
"EYE_TRACKING": "Eye + pinch"
|
||||
"EYE_TRACKING": "Eye + pinch",
|
||||
"HMD_ONLY": "HMD only",
|
||||
"EYE_ONLY": "Eye only"
|
||||
}
|
||||
},
|
||||
"DEFAULT": "Default",
|
||||
|
||||
@@ -348,7 +348,7 @@ impl OpenXrPointer {
|
||||
) -> anyhow::Result<()> {
|
||||
match session.config.handsfree_pointer {
|
||||
HandsfreePointer::None => return Ok(()),
|
||||
HandsfreePointer::Hmd => {
|
||||
HandsfreePointer::Hmd | HandsfreePointer::HmdOnly => {
|
||||
pointer.tracked = hmd_tracked;
|
||||
pointer.raw_pose = hmd;
|
||||
pointer.pose = hmd;
|
||||
@@ -364,13 +364,21 @@ impl OpenXrPointer {
|
||||
cur_pos.lerp(new_pos.into(), lerp_factor).into(),
|
||||
);
|
||||
}
|
||||
HandsfreePointer::EyeTracking => {
|
||||
HandsfreePointer::EyeTracking | HandsfreePointer::EyeTrackingOnly => {
|
||||
// more aggressive smoothing for eye
|
||||
self.pointer_load_pose(pointer, xr, session.config.pointer_lerp_factor * 0.5)?;
|
||||
}
|
||||
}
|
||||
|
||||
pointer.handsfree = pointer.tracked;
|
||||
if matches!(
|
||||
session.config.handsfree_pointer,
|
||||
HandsfreePointer::HmdOnly | HandsfreePointer::EyeTrackingOnly
|
||||
) {
|
||||
// skip actions
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
self.pointer_load_actions(pointer, xr, session)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::{rc::Rc, time::Duration};
|
||||
|
||||
use glam::{Affine3A, Quat, Vec3, Vec3A, vec3};
|
||||
use glam::{Affine3A, Quat, Vec3, vec3};
|
||||
use wgui::{
|
||||
assets::AssetPath,
|
||||
components::button::ComponentButton,
|
||||
@@ -23,11 +23,7 @@ use crate::{
|
||||
timer::GuiTimer,
|
||||
},
|
||||
state::AppState,
|
||||
windowing::{
|
||||
Z_ORDER_WATCH,
|
||||
backend::OverlayEventData,
|
||||
window::{OverlayWindowConfig, OverlayWindowData},
|
||||
},
|
||||
windowing::{Z_ORDER_WATCH, backend::OverlayEventData, window::OverlayWindowConfig},
|
||||
};
|
||||
|
||||
pub const WATCH_NAME: &str = "watch";
|
||||
|
||||
@@ -12,7 +12,6 @@ use wlx_common::{
|
||||
astr_containers::{AStrMap, AStrMapExt},
|
||||
config::SerializedWindowSet,
|
||||
overlays::{BackendAttrib, BackendAttribValue, ToastTopic},
|
||||
windowing::Positioning,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
|
||||
@@ -57,8 +57,12 @@ pub enum HandsfreePointer {
|
||||
#[strum(props(Translation = "APP_SETTINGS.OPTION.HMD_PINCH"))]
|
||||
#[default]
|
||||
Hmd,
|
||||
#[strum(props(Translation = "APP_SETTINGS.OPTION.HMD_ONLY"))]
|
||||
HmdOnly,
|
||||
#[strum(props(Translation = "APP_SETTINGS.OPTION.EYE_PINCH"))]
|
||||
EyeTracking,
|
||||
#[strum(props(Translation = "APP_SETTINGS.OPTION.EYE_ONLY"))]
|
||||
EyeTrackingOnly,
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user