wip: fix(input): grr
Some checks failed
/ build (push) Has been cancelled

todo: per-key inptut map layering
This commit is contained in:
🪞👃🪞 2025-06-22 09:40:28 +03:00
parent 11f686650f
commit 6c3a0964ec
5 changed files with 388 additions and 65 deletions

View file

@ -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 {