index : nmrs-tui
A fast, Vim-friendly NetworkManager TUI built in Rust.
about summary refs log tree commit diff

Diffstat (limited to 'src/events/mod.rs')

-rw-r--r-- src/events/mod.rs 16
 1 file changed, 16 insertions(+)

diff --git a/src/events/mod.rs b/src/events/mod.rs
new file mode 100644
index 0000000..bd39a6c 100644
--- /dev/null
+++ b/src/events/mod.rs
@@ -1,0 +1,16 @@
use crate::app::{App, Focus};
use crossterm::event::{KeyEvent, KeyEventKind};

mod popups;
mod tabs;

pub fn handle_events(app: &mut App, key: KeyEvent) {
    if key.kind != KeyEventKind::Press {
        return;
    }

    match app.focus {
        Focus::Tab(tab) => tabs::handle(app, key, tab),
        Focus::Popup(_) => popups::handle(app, key),
    }
}