use razerctl::RazerDevice;
use std::{io::Error, thread, time::Duration};
fn main() -> Result<(), Error> {
let mut device = RazerDevice::new()?;
println!("Initialized");
const VK_SPACE: u8 = 0x20;
for i in 1..=5 {
println!("Simulating Spacebar press {}...", i);
device.key_down(VK_SPACE)?;
thread::sleep(Duration::from_millis(50));
device.key_up(VK_SPACE)?;
println!("Spacebar press {} sent.", i);
if i < 5 {
thread::sleep(Duration::from_millis(500));
}
}
Ok(())
}