mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
tui: add pgup/pgdn and extract tui_keys
This commit is contained in:
parent
7ba37f3f02
commit
95149b79c4
4 changed files with 136 additions and 130 deletions
|
|
@ -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 ));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue