From 78a73bba1a3cabfca827eac3cecf4360b3fddb3f Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Fri, 17 Feb 2023 14:15:56 +0100 Subject: [PATCH] Fix: click_button for windows --- receiver/src/keyboard.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/receiver/src/keyboard.rs b/receiver/src/keyboard.rs index 0c1af10..f9299d1 100644 --- a/receiver/src/keyboard.rs +++ b/receiver/src/keyboard.rs @@ -31,6 +31,10 @@ pub fn type_text(text: &str) -> Result<(),()>{ } #[cfg(target_family = "windows")] -pub fn click_tab() -> Result<(),()> { - simulate::send(simulate::Key::Tab).map_err(|_| ()) +pub fn click_button(button: ContinueButton) -> Result<(),()> { + let button = match button { + ContinueButton::Tab => simulate::Key::Tab, + ContinueButton::Enter => simulate::Key::Return, + }; + simulate::send(button).map_err(|_| ()) } \ No newline at end of file