fix(input): InputMap manual Default impl

This commit is contained in:
🪞👃🪞 2025-07-14 23:06:29 +03:00
parent 38d29f30a7
commit ca4c558eab

View file

@ -4,12 +4,17 @@ use crate::*;
/// Each contained layer defines a mapping from input event to command invocation
/// over a given state. Furthermore, each layer may have an associated cond,
/// so that only certain layers are active at a given time depending on state.
#[derive(Debug, Default)] pub struct InputMap<I, T: Dsl>(
#[derive(Debug)] pub struct InputMap<I, T: Dsl>(
/// Map of input event (key combination) to
/// all command expressions bound to it by
/// all loaded input layers.
pub BTreeMap<I, Vec<InputBinding<T>>>
);
impl<I, T: Dsl> Default for InputMap<I, T> {
fn default () -> Self {
Self(Default::default())
}
}
#[derive(Debug, Default)] pub struct InputBinding<T: Dsl> {
condition: Option<T>,
command: T,