2021-03-29 15:59:14 +08:00
|
|
|
use enigo::{Enigo, Key, KeyboardControllable};
|
|
|
|
use std::thread;
|
|
|
|
use std::time::Duration;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
thread::sleep(Duration::from_secs(2));
|
|
|
|
let mut enigo = Enigo::new();
|
|
|
|
|
2021-12-24 19:13:11 +08:00
|
|
|
enigo.key_down(Key::Layout('a')).ok();
|
2021-03-29 15:59:14 +08:00
|
|
|
thread::sleep(Duration::from_secs(1));
|
|
|
|
enigo.key_up(Key::Layout('a'));
|
|
|
|
}
|