use crossterm::event::KeyEvent;
#[derive(Debug)]
pub enum SetupEvent {
Key(KeyEvent),
Paste(String),
}
#[derive(Debug)]
pub enum SetupAction {
Key(KeyEvent),
Paste(String),
}
pub fn map_setup_event(event: SetupEvent) -> SetupAction {
match event {
SetupEvent::Key(key) => SetupAction::Key(key),
SetupEvent::Paste(text) => SetupAction::Paste(text),
}
}
impl super::SetupWizard {
pub fn update(&mut self, action: SetupAction) -> anyhow::Result<bool> {
match action {
SetupAction::Key(key) => self.handle_key(&key),
SetupAction::Paste(text) => {
self.handle_paste(&text);
Ok(false)
}
}
}
}