mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-06 03:36:42 +01:00
fix(input): InputMap manual Default impl
This commit is contained in:
parent
38d29f30a7
commit
ca4c558eab
1 changed files with 6 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue