diff --git a/receiver/src/keyboard.rs b/receiver/src/keyboard.rs index d6d7e01..72fcf8b 100644 --- a/receiver/src/keyboard.rs +++ b/receiver/src/keyboard.rs @@ -2,13 +2,15 @@ use enigo::{KeyboardControllable}; #[cfg(target_family = "unix")] -pub fn type_text(text: &str) { +pub fn type_text(text: &str) -> Result<(),()> { enigo::Enigo::default().key_sequence(text); + Ok(()) } #[cfg(target_family = "unix")] -pub fn click_tab() { +pub fn click_tab() -> Result<(),()> { enigo::Enigo::default().key_click(enigo::Key::Tab); + Ok(()) } #[cfg(target_family = "windows")] diff --git a/receiver/src/main.rs b/receiver/src/main.rs index 4516dff..bd5400d 100644 --- a/receiver/src/main.rs +++ b/receiver/src/main.rs @@ -81,7 +81,7 @@ fn main() { let password = "test"; let broker_domain = "broker.emqx.io"; - let mut c = comm::Comm::new(&broker_domain, &password, handle_time).unwrap(); + let c = comm::Comm::new(&broker_domain, &password, handle_time).unwrap(); //Gui::run(Settings::default());