From 9e564576e64ca5f351960640a8304824f06764c8 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Thu, 16 Feb 2023 11:01:16 +0100 Subject: [PATCH] Fix: compile for Linux --- receiver/src/keyboard.rs | 6 ++++-- receiver/src/main.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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());