use simulate_key::{simulate_key, simulate_key_hold, get_supported_keys};
use std::thread;
use std::time::Duration;
fn main() {
println!("Key Simulator Demo");
println!("==================");
println!("Starting in 3 seconds...");
thread::sleep(Duration::from_secs(3));
println!("Typing 'Hello World!'");
simulate_key("h").unwrap();
simulate_key("e").unwrap();
simulate_key("l").unwrap();
simulate_key("l").unwrap();
simulate_key("o").unwrap();
simulate_key("space").unwrap();
simulate_key("shift+w").unwrap(); simulate_key("o").unwrap();
simulate_key("r").unwrap();
simulate_key("l").unwrap();
simulate_key("d").unwrap();
simulate_key("shift+1").unwrap();
thread::sleep(Duration::from_secs(1));
println!("Testing key combinations...");
simulate_key("ctrl+a").unwrap(); thread::sleep(Duration::from_millis(100));
simulate_key("ctrl+c").unwrap(); thread::sleep(Duration::from_millis(100));
simulate_key("ctrl+v").unwrap();
thread::sleep(Duration::from_secs(1));
simulate_key("f5").unwrap();
thread::sleep(Duration::from_secs(1));
println!("Holding space for 1 second...");
simulate_key_hold("space", 1000).unwrap();
println!("\nSupported keys:");
let keys = get_supported_keys();
for (i, key) in keys.iter().enumerate() {
print!("{}", key);
if i < keys.len() - 1 {
print!(", ");
}
if (i + 1) % 10 == 0 {
println!();
}
}
println!();
}