use {
crokey::*,
crossterm::event::{
KeyCode,
KeyModifiers,
},
once_cell::sync::Lazy,
};
pub static KEY_FORMAT: Lazy<KeyCombinationFormat> =
Lazy::new(|| KeyCombinationFormat::default().with_lowercase_modifiers());
pub fn is_reserved(key: KeyCombination) -> bool {
key == key!(backspace) || key == key!(delete) || key == key!(esc)
}
pub fn is_key_only_modal(key: KeyCombination) -> bool {
matches!(
key,
KeyCombination {
codes: OneToThree::One(KeyCode::Char(_)),
modifiers: KeyModifiers::NONE | KeyModifiers::SHIFT,
}
)
}