Shortcuts: Numpad * marks the selected layers (#976)

Numpad * always added a composition marker. As in After Effects, it now
adds a layer marker to the selected layers at the current time, and a
composition marker only when no layer is selected.
This commit is contained in:
Marco Arnulfo
2026-10-12 14:43:18 +02:00
parent 3174e68d0e
commit 424dcab40b
2 changed files with 31 additions and 1 deletions
+5
View File
@@ -1744,6 +1744,11 @@ fn handle_shortcuts_impl(app: &mut EffectcraftApp, ctx: &egui::Context, tab_only
// comes as text.
if !tab_only && clipboard && app.dialog.is_none() && ctx.input(|i| i.events.iter().any(|e| matches!(e, egui::Event::Text(t) if t == "*"))) {
let bound = app.session.shortcuts().bindings().into_iter().find(|(k, _)| *k == "Num*").map(|(_, b)| (b.command.clone(), b.params.clone()));
// As in After Effects, it marks the selected layers; only with none selected does it add
// a composition marker (#976).
let bound = bound.map(|(id, params)| {
if id == "comp.addMarker" && !app.session.state.selected_layers.is_empty() { ("layer.addMarker".to_owned(), params) } else { (id, params) }
});
if let Some((id, params)) = bound
&& let Err(e) = invoke(app, ctx, &id, if params.is_null() { json!({}) } else { params })
{