use std::{
thread::{sleep, spawn},
time::Duration,
};
use windows_hotkeys::{
keys::{ModKey, VKey},
singlethreaded::HotkeyManager,
HotkeyManagerImpl,
};
fn main() {
let mut hkm = HotkeyManager::new();
hkm.register(VKey::A, &[ModKey::Alt], || {
println!("Hotkey ALT + A was pressed");
})
.unwrap();
let handle = hkm.interrupt_handle();
spawn(move || {
sleep(Duration::from_secs(5));
handle.interrupt();
});
hkm.event_loop();
println!("Event Loop interrupted");
}