use crate::error::Result;
use crate::keyflow::Keyflow;
use crate::types::Screen;
pub struct KeyflowBuilder {
pub(crate) enable_hotkeys: bool,
pub(crate) screen: Option<Screen>,
}
impl Default for KeyflowBuilder {
fn default() -> Self {
Self::new()
}
}
impl KeyflowBuilder {
pub fn new() -> Self {
Self {
enable_hotkeys: false,
screen: None,
}
}
pub fn with_hotkeys(mut self) -> Self {
self.enable_hotkeys = true;
self
}
pub fn with_screen(mut self, screen: Screen) -> Self {
self.screen = Some(screen);
self
}
pub fn initialize(self) -> Result<()> {
Keyflow::initialize_with_config(self)
}
}
impl Keyflow {
pub fn builder() -> KeyflowBuilder {
KeyflowBuilder::new()
}
}