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

Method send_key

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

Source from the content-addressed store, hash-verified

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)

Callers 3

mainFunction · 0.45
press_tvos_remote_keyFunction · 0.45
type_textFunction · 0.45

Calls 7

hid_text_for_keyFunction · 0.85
android_key_codeFunction · 0.85
type_text_adbMethod · 0.80
serial_for_idMethod · 0.80
press_android_keyMethod · 0.80

Tested by

no test coverage detected