forked from 1b-agent/opencadstudio-upstream
feat(input): add editable shortcut table
Persist all active bindings and route keyboard events through the configured table.\n\nRefs #449
This commit is contained in:
1 parent
3f6959d7d0
commit
2f86bfde8e
9 files changed
+448
-337
No files matched your search
@@ -530,6 +530,13 @@ impl OpenCADStudio {
|
||||
collapse: self.ribbon.collapse_mode(),
|
||||
},
|
||||
plot: self.plot_dialog.clone(),
|
||||
shortcuts: crate::app::config::ShortcutConfig {
|
||||
bindings: self
|
||||
.shortcut_bindings
|
||||
.iter()
|
||||
.map(|(key, command)| (key.clone(), command.clone()))
|
||||
.collect(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -565,6 +572,7 @@ impl OpenCADStudio {
|
||||
self.annotation_auto_scale = cfg.annotation_auto_scale.clamp(-4, 4);
|
||||
self.ribbon.set_collapse_mode(cfg.ribbon.collapse);
|
||||
self.plot_dialog = cfg.plot;
|
||||
self.shortcut_bindings = cfg.shortcuts.bindings.into_iter().collect();
|
||||
}
|
||||
|
||||
/// Write the config only when it changed since the last write, so a toggle
|
||||
|
||||
Reference in new issue
Block a user