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

Method press_android_key_combination

packages/server/src/android.rs:520–537  ·  view source on GitHub ↗
(
        &self,
        serial: &str,
        key_code: u16,
        modifiers: u32,
    )

Source from the content-addressed store, hash-verified

518 }
519
520 fn press_android_key_combination(
521 &self,
522 serial: &str,
523 key_code: u16,
524 modifiers: u32,
525 ) -> Result<(), AppError> {
526 let mut parts = vec!["input".to_owned(), "keycombination".to_owned()];
527 parts.extend(
528 android_modifier_key_codes(modifiers)
529 .into_iter()
530 .map(|key| key.to_string()),
531 );
532 parts.push(key_code.to_string());
533 match self.run_adb_shell(serial, &parts.join(" ")) {
534 Ok(_) => Ok(()),
535 Err(_) => self.press_android_key(serial, key_code),
536 }
537 }
538
539 pub fn press_home(&self, id: &str) -> Result<(), AppError> {
540 let serial = self.serial_for_id(id)?;

Callers 1

send_keyMethod · 0.80

Calls 3

run_adb_shellMethod · 0.80
press_android_keyMethod · 0.80

Tested by

no test coverage detected