keyflow 0.1.1

Cross-platform input simulation library for keyboard, mouse and hotkeys.
Documentation
use crate::hotkey::Hotkey;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum KeyflowError {
    #[error("Keyflow not initialized")]
    NotInitialized,

    #[error("Keyflow already initialized")]
    AlreadyInitialized,

    #[error("Platform error: {0}")]
    PlatformError(String),

    #[error(
        "Hotkeys not enabled. Use Keyflow::builder().with_hotkeys().initialize() to enable hotkeys"
    )]
    HotkeysNotEnabled,

    #[error("Hotkey already exists: {0:?}")]
    HotkeyExists(Hotkey),

    #[error("Hotkey ID already exists: {0}")]
    HotkeyIdExists(String),

    #[error("Hotkey not found: {0}")]
    HotkeyNotFound(String),

    #[error("No keyboards found")]
    KeyboardsNotFound,

    #[error("Channel is disconnected")]
    ChannelDisconnected,

    #[error("IO error: {0}")]
    Io(#[from] std::io::Error),
}

pub type Result<T> = std::result::Result<T, KeyflowError>;