config: allow consuming/forwarding key events
This commit is contained in:
parent
6ee4fdb9f4
commit
18bc86d14f
12 changed files with 106 additions and 13 deletions
|
|
@ -49,6 +49,7 @@ pub enum SimpleCommand {
|
|||
ToggleFullscreen,
|
||||
ToggleMono,
|
||||
ToggleSplit,
|
||||
Forward(bool),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ impl ActionParser<'_> {
|
|||
"reload-config-toml" => ReloadConfigToml,
|
||||
"reload-config-so" => ReloadConfigSo,
|
||||
"none" => None,
|
||||
"forward" => Forward(true),
|
||||
"consume" => Forward(false),
|
||||
_ => {
|
||||
return Err(ActionParserError::UnknownSimpleAction(string.to_string()).spanned(span))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ impl Action {
|
|||
}
|
||||
SimpleCommand::ReloadConfigSo => Box::new(reload),
|
||||
SimpleCommand::None => Box::new(|| ()),
|
||||
SimpleCommand::Forward(bool) => Box::new(move || s.set_forward(bool)),
|
||||
},
|
||||
Action::Multi { actions } => {
|
||||
let mut actions: Vec<_> = actions.into_iter().map(|a| a.into_fn(state)).collect();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue