forked from 1b-agent/opencadstudio-upstream
fix(input): let a rebound SPACE fire while the command line has focus
A focused text field reports Status::Captured, so the key dispatch dropped SPACE and a CUI rebind of SPACE to FINALIZE never ran while the command line held focus (#1710). Dispatch a captured SPACE as a shortcut only when SPACE is bound to something other than COMMANDSPACE, so the default binding still types a space. The closure stays a plain fn, so a static flag mirrors the binding and is refreshed wherever the bindings change.
This commit is contained in:
1 parent
4b6ced9b8c
commit
cbefecb120
5 files changed
+121
-3
No files matched your search
@@ -449,6 +449,7 @@ impl OpenCADStudio {
|
||||
}
|
||||
}
|
||||
}
|
||||
crate::app::shortcuts::sync_space_dispatch_flag(&self.shortcut_bindings);
|
||||
self.persist_settings_if_changed();
|
||||
self.command_line.push_output(
|
||||
crate::tf!("CUIIMPORT: loaded {n} shortcut(s) from \"{path}\".")
|
||||
@@ -483,6 +484,9 @@ impl OpenCADStudio {
|
||||
self.command_line.push_error(crate::t!("Usage: SHORTCUTS SET <key> <command> e.g. SHORTCUTS SET CTRL+D DIST").as_ref());
|
||||
} else {
|
||||
self.shortcut_bindings.insert(key.clone(), cmd_str.clone());
|
||||
crate::app::shortcuts::sync_space_dispatch_flag(
|
||||
&self.shortcut_bindings,
|
||||
);
|
||||
self.persist_settings_if_changed();
|
||||
self.command_line.push_output(
|
||||
crate::tf!("Shortcut set: {key} → {cmd_str}").as_ref(),
|
||||
@@ -500,6 +504,9 @@ impl OpenCADStudio {
|
||||
.remove(&crate::app::shortcuts::normalize_key(&key))
|
||||
.is_some()
|
||||
{
|
||||
crate::app::shortcuts::sync_space_dispatch_flag(
|
||||
&self.shortcut_bindings,
|
||||
);
|
||||
self.persist_settings_if_changed();
|
||||
self.command_line
|
||||
.push_output(crate::tf!("Shortcut '{key}' removed.").as_ref());
|
||||
|
||||
Reference in new issue
Block a user