doc: add procedure

This commit is contained in:
eneller
2026-01-28 19:29:08 +01:00
parent 8aca73cd9c
commit d1d9a782f8
4 changed files with 17 additions and 7 deletions

View File

@@ -4,11 +4,6 @@ use std::ptr;
use tauri::Manager;
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
#[tauri::command]
fn send_key(key: String) -> Result<(), String> {
let mut enigo = Enigo::new(&Settings::default()).map_err(|e| format!("Enigo error: {}", e))?;
@@ -118,7 +113,7 @@ pub fn run() {
Ok(())
})
.plugin(tauri_plugin_opener::init())
.invoke_handler(tauri::generate_handler![greet, send_key])
.invoke_handler(tauri::generate_handler![send_key])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}