wip: cmdsys: define arranger commands

This commit is contained in:
🪞👃🪞 2024-11-07 01:10:52 +01:00
parent abbe0dc8f7
commit 1f375219db
3 changed files with 40 additions and 2 deletions

View file

@ -26,7 +26,7 @@ pub trait Command<T>: Sized {
}
pub trait HandleKey<C: Command<Self> + 'static>: Sized {
const HANDLE_KEY_MAP: &'static [(KeyEvent, C)];
const HANDLE_KEY_MAP: &'static [(KeyEvent, C)]; // FIXME: needs to be method
fn match_key (key: &KeyEvent) -> Option<&'static C> {
for (binding, command) in Self::HANDLE_KEY_MAP.iter() {
if key == binding {