index : nmrs-tui
A fast, Vim-friendly NetworkManager TUI built in Rust.
about summary refs log tree commit diff
nmrs-tui / src / events / mod.rs
-rw-r--r-- blob bd39a6c06ad3a7b595f0b2028655213a641f64da 358 bytes (plain)
1
use crate::app::{App, Focus};
2
use crossterm::event::{KeyEvent, KeyEventKind};
3
4
mod popups;
5
mod tabs;
6
7
pub fn handle_events(app: &mut App, key: KeyEvent) {
8
    if key.kind != KeyEventKind::Press {
9
        return;
10
    }
11
12
    match app.focus {
13
        Focus::Tab(tab) => tabs::handle(app, key, tab),
14
        Focus::Popup(_) => popups::handle(app, key),
15
    }
16
}