MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / send_touch

Method send_touch

packages/server/src/android.rs:423–433  ·  view source on GitHub ↗
(&self, id: &str, x: f64, y: f64, phase: &str)

Source from the content-addressed store, hash-verified

421 }
422
423 pub fn send_touch(&self, id: &str, x: f64, y: f64, phase: &str) -> Result<(), AppError> {
424 let serial = self.serial_for_id(id)?;
425 let (width, height) = self.screen_size_for_serial(&serial)?;
426 let px = (x.clamp(0.0, 1.0) * (width - 1.0)).round().max(0.0) as u32;
427 let py = (y.clamp(0.0, 1.0) * (height - 1.0)).round().max(0.0) as u32;
428 let button_state = android_mouse_button_state_for_touch_phase(phase)?;
429 self.run_console_command_for_serial(
430 &serial,
431 &format!("event mouse {px} {py} 0 {button_state}"),
432 )
433 }
434
435 pub fn send_swipe(
436 &self,

Callers 3

mainFunction · 0.45
perform_tap_with_inputFunction · 0.45
perform_swipeFunction · 0.45

Calls 5

serial_for_idMethod · 0.80
maxMethod · 0.80

Tested by

no test coverage detected