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:
Hakan Seven 2026-08-04 15:35:06 +03:00
commit 2f86bfde8e
9 changed files with 445 additions and 334 deletions

View file

@ -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