config: add warp-mouse-to-focus action
This commit is contained in:
parent
107245d877
commit
aaf02dc4e1
13 changed files with 74 additions and 2 deletions
|
|
@ -91,6 +91,7 @@ pub enum SimpleCommand {
|
|||
ReloadSimpleIm,
|
||||
EnableUnicodeInput,
|
||||
OpenControlCenter,
|
||||
WarpMouseToFocus,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ impl ActionParser<'_> {
|
|||
"reload-simple-im" => ReloadSimpleIm,
|
||||
"enable-unicode-input" => EnableUnicodeInput,
|
||||
"open-control-center" => OpenControlCenter,
|
||||
"warp-mouse-to-focus" => WarpMouseToFocus,
|
||||
_ => {
|
||||
return Err(
|
||||
ActionParserError::UnknownSimpleAction(string.to_string()).spanned(span)
|
||||
|
|
|
|||
|
|
@ -247,6 +247,10 @@ impl Action {
|
|||
b.new(move || persistent.seat.enable_unicode_input())
|
||||
}
|
||||
SimpleCommand::OpenControlCenter => b.new(open_control_center),
|
||||
SimpleCommand::WarpMouseToFocus => {
|
||||
let persistent = state.persistent.clone();
|
||||
b.new(move || persistent.seat.warp_mouse_to_focus())
|
||||
}
|
||||
},
|
||||
Action::Multi { actions } => {
|
||||
let actions: Vec<_> = actions.into_iter().map(|a| a.into_fn(state)).collect();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue