keyboard/keyboard.rs
1use mouse_keyboard_input::VirtualDevice;
2use mouse_keyboard_input::key_codes::*;
3use std::thread;
4use std::time::Duration;
5
6fn main() {
7 let mut device = VirtualDevice::default().unwrap();
8
9 thread::sleep(Duration::from_secs(2));
10
11 // type hello
12 for key in [KEY_H, KEY_E, KEY_L, KEY_L, KEY_O] {
13 device.click(key).unwrap();
14 }
15}