Initial Radarr ui!

This commit is contained in:
2023-08-08 10:50:04 -06:00
parent 3ae7e15961
commit 1ebf481326
11 changed files with 245 additions and 82 deletions
+10
View File
@@ -5,6 +5,8 @@ use crossterm::event::{KeyCode, KeyEvent};
#[derive(Debug, PartialEq, Eq)]
pub enum Key {
Up,
Down,
Char(char),
Unknown,
}
@@ -21,6 +23,14 @@ impl Display for Key {
impl From<KeyEvent> for Key {
fn from(key_event: KeyEvent) -> Self {
match key_event {
KeyEvent {
code: KeyCode::Up,
..
} => Key::Up,
KeyEvent {
code: KeyCode::Down,
..
} => Key::Down,
KeyEvent {
code: KeyCode::Char(c),
..