Auto-Send Feature

This commit is contained in:
Elizabeth Cray
2024-05-16 18:34:48 -04:00
parent ee392d5213
commit 7d3dba469d
4 changed files with 31 additions and 5 deletions

View File

@@ -15,7 +15,7 @@ fn get_mouse_pos() -> String {
}
#[tauri::command]
fn type_str(input: String) {
fn type_str(input: String, autoSend: bool) {
#[cfg(dev)]
println!(">: {}", input);
@@ -64,6 +64,12 @@ fn type_str(input: String) {
enigo.key_up(Key::Control);
}
thread::sleep(Duration::from_millis(200));
if (autoSend) {
enigo.key_click(Key::Return);
}
thread::sleep(Duration::from_millis(20));
// Close program