mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 11:46:42 +01:00
todo: per-key inptut map layering
This commit is contained in:
parent
11f686650f
commit
6c3a0964ec
5 changed files with 388 additions and 65 deletions
|
|
@ -3,7 +3,7 @@ use crate::{dsl::*, input::*, tui::TuiIn};
|
|||
use crossterm::event::{Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, KeyEventState};
|
||||
|
||||
#[test] fn test_subcommand () -> Usually<()> {
|
||||
struct Test { keys: InputLayers<Ast> }
|
||||
struct Test { keys: InputMap<(), Ast> }
|
||||
|
||||
handle!(TuiIn: |self: Test, input|Ok(None));/*if let Some(command) = self.keys.command(self, input) {
|
||||
Ok(Some(true))
|
||||
|
|
@ -35,12 +35,12 @@ use crossterm::event::{Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, Key
|
|||
}
|
||||
|
||||
let mut test = Test {
|
||||
keys: InputLayers::from("
|
||||
keys: InputMap::from_source("
|
||||
(@a do-thing)
|
||||
(@b do-thing-arg 0)
|
||||
(@c do-sub do-other-thing)
|
||||
(@d do-sub do-other-thing-arg 0)
|
||||
")
|
||||
")?
|
||||
};
|
||||
|
||||
//assert_eq!(Some(true), test.handle(&TuiIn(Default::default(), Event::Key(KeyEvent {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue