rowdy-db 0.5.0

A fast, modern, and rowdy TUI database management tool written in Rust.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crossterm::event::KeyCode;
use crate::app::App;
use crate::events::app_event::AppEvent;

pub fn handle_event(app: &mut App, event: AppEvent) {
    match event {
        AppEvent::Key(key) => match key.code {
            KeyCode::Char('q') => app.should_quit = true,
            KeyCode::Char('h') | KeyCode::Left  => {}
            KeyCode::Char('j') | KeyCode::Down  => {}
            KeyCode::Char('k') | KeyCode::Up    => {}
            KeyCode::Char('l') | KeyCode::Right => {}
            _ => {}
        },
        AppEvent::Quit => app.should_quit = true,
        _ => {}
    }
}