(&self, id: &str, x: f64, y: f64, phase: &str)
| 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, |
no test coverage detected