use iced::keyboard;
use crate::gandalf::Message;
pub fn handle(key_code: keyboard::KeyCode) -> Option<Message> {
match key_code {
keyboard::KeyCode::Up => Some(Message::MoveCursor(true)),
keyboard::KeyCode::Down | keyboard::KeyCode::Tab => Some(Message::MoveCursor(false)),
keyboard::KeyCode::Enter => Some(Message::Execute),
keyboard::KeyCode::Escape => Some(Message::Exit),
_ => None,
}
}