keyflow 0.1.1

Cross-platform input simulation library for keyboard, mouse and hotkeys.
Documentation
use keyflow::prelude::*;
use std::thread;
use std::time::Duration;

fn main() -> Result<()> {
    Keyflow::builder()
        .with_screen(Screen::default())
        .initialize()?;

    thread::sleep(Duration::from_secs(2));

    #[rustfmt::skip]
    // Typing with batch
    let batch = vec![
        InputEvent::KeyEvent { key: Key::ShiftLeft, action: Action::Press},
        InputEvent::KeyEvent { key: Key::H, action: Action::Click},
        InputEvent::KeyEvent { key: Key::ShiftLeft, action: Action::Release},
        InputEvent::KeyEvent { key: Key::E, action: Action::Click},
        InputEvent::KeyEvent { key: Key::L, action: Action::Click},
        InputEvent::KeyEvent { key: Key::L, action: Action::Click},
        InputEvent::KeyEvent { key: Key::O, action: Action::Click},
        InputEvent::KeyEvent { key: Key::Space, action: Action::Click},
        InputEvent::Delay(Duration::from_millis(1000)),
        InputEvent::KeyEvent { key: Key::ShiftRight, action: Action::Press},
        InputEvent::KeyEvent { key: Key::K, action: Action::Click},
        InputEvent::KeyEvent { key: Key::ShiftRight, action: Action::Release},
        InputEvent::KeyEvent { key: Key::E, action: Action::Click},
        InputEvent::KeyEvent { key: Key::Y, action: Action::Click},
        InputEvent::KeyEvent { key: Key::F, action: Action::Click},
        InputEvent::KeyEvent { key: Key::L, action: Action::Click},
        InputEvent::KeyEvent { key: Key::O, action: Action::Click},
        InputEvent::KeyEvent { key: Key::W, action: Action::Click},
    ];

    Keyflow::batch(batch);

    thread::sleep(Duration::from_secs(2));

    Ok(())
}