(&self, id: &str, key_code: u16, modifiers: u32)
| 483 | } |
| 484 | |
| 485 | pub fn send_key(&self, id: &str, key_code: u16, modifiers: u32) -> Result<(), AppError> { |
| 486 | if let Some(text) = hid_text_for_key(key_code, modifiers) { |
| 487 | return self.type_text_adb(id, &text); |
| 488 | } |
| 489 | |
| 490 | let serial = self.serial_for_id(id)?; |
| 491 | let android_key = android_key_code(key_code); |
| 492 | if has_android_key_modifiers(modifiers) { |
| 493 | return self.press_android_key_combination(&serial, android_key, modifiers); |
| 494 | } |
| 495 | self.press_android_key(&serial, android_key) |
| 496 | } |
| 497 | |
| 498 | pub fn type_text(&self, id: &str, text: &str) -> Result<(), AppError> { |
| 499 | self.type_text_adb(id, text) |
no test coverage detected