textual 1.0.0-dev

A reactive TUI framework inspired by the Python Textual library
Documentation
1
2
3
4
5
6
7
8
9
10
use crossterm::event::{KeyCode, KeyModifiers};
use textual::event::{Action, ActionMap, KeyBind};

#[test]
fn action_map_binds_and_resolves() {
    let mut map = ActionMap::new();
    let bind = KeyBind::new(KeyCode::Char('j'), KeyModifiers::empty());
    map.bind(bind, Action::ScrollDown);
    assert_eq!(map.lookup(&bind), Some(Action::ScrollDown));
}