DeviceHaptics task
This commit is contained in:
@@ -214,15 +214,17 @@ pub async fn wvr_process_launch(
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn wlx_haptics(
|
||||
pub async fn wlx_device_haptics(
|
||||
state: &mut WayVRClientState,
|
||||
device: usize,
|
||||
intensity: f32,
|
||||
duration: f32,
|
||||
frequency: f32,
|
||||
) {
|
||||
handle_empty_result(
|
||||
WayVRClient::fn_wlx_haptics(
|
||||
WayVRClient::fn_wlx_device_haptics(
|
||||
state.wayvr_client.clone(),
|
||||
device,
|
||||
packet_client::WlxHapticsParams {
|
||||
intensity,
|
||||
duration,
|
||||
|
||||
@@ -10,7 +10,7 @@ use env_logger::Env;
|
||||
use wayvr_ipc::{client::WayVRClient, ipc, packet_client};
|
||||
|
||||
use crate::helper::{
|
||||
WayVRClientState, wlx_haptics, wlx_input_state, wlx_panel_modify, wvr_display_create,
|
||||
WayVRClientState, wlx_device_haptics, wlx_input_state, wlx_panel_modify, wvr_display_create,
|
||||
wvr_display_get, wvr_display_list, wvr_display_remove, wvr_display_set_visible,
|
||||
wvr_display_window_list, wvr_process_get, wvr_process_launch, wvr_process_list,
|
||||
wvr_process_terminate, wvr_window_set_visible,
|
||||
@@ -162,11 +162,12 @@ async fn run_once(state: &mut WayVRClientState, args: Args) -> anyhow::Result<()
|
||||
wvr_process_launch(state, exec, name, env, handle, args, HashMap::new()).await;
|
||||
}
|
||||
Subcommands::Haptics {
|
||||
device,
|
||||
intensity,
|
||||
duration,
|
||||
frequency,
|
||||
} => {
|
||||
wlx_haptics(state, intensity, duration, frequency).await;
|
||||
wlx_device_haptics(state, device, intensity, duration, frequency).await;
|
||||
}
|
||||
Subcommands::PanelModify {
|
||||
overlay,
|
||||
@@ -283,6 +284,8 @@ enum Subcommands {
|
||||
},
|
||||
/// Trigger haptics on the user's controller
|
||||
Haptics {
|
||||
/// 0 for left, 1 for right controller
|
||||
device: usize,
|
||||
#[arg(short, long, default_value = "0.25")]
|
||||
intensity: f32,
|
||||
#[arg(short, long, default_value = "0.1")]
|
||||
|
||||
Reference in New Issue
Block a user