tui: add pgup/pgdn and extract tui_keys

This commit is contained in:
🪞👃🪞 2025-04-27 16:28:05 +03:00
parent 7ba37f3f02
commit 95149b79c4
4 changed files with 136 additions and 130 deletions

View file

@ -63,3 +63,18 @@ pub(crate) use std::ffi::OsString;
//engine.run(&state)?;
Ok(())
}
#[cfg(test)] #[test] fn test_parse_key () {
use KeyModifiers as Mods;
let test = |x: &str, y|assert_eq!(KeyMatcher::new(x).build(), Some(Event::Key(y)));
//test(":x",
//KeyEvent::new(KeyCode::Char('x'), Mods::NONE));
//test(":ctrl-x",
//KeyEvent::new(KeyCode::Char('x'), Mods::CONTROL));
//test(":alt-x",
//KeyEvent::new(KeyCode::Char('x'), Mods::ALT));
//test(":shift-x",
//KeyEvent::new(KeyCode::Char('x'), Mods::SHIFT));
//test(":ctrl-alt-shift-x",
//KeyEvent::new(KeyCode::Char('x'), Mods::CONTROL | Mods::ALT | Mods::SHIFT ));
}