Skip to content

EffectCraft: An open-source motion graphics and compositing tool written by scratch in pure Rust

Default keys for ten commands that had none

pravdomil6f5bd0c27298
diff --git a/crates/engine/src/commands/app_more.rs b/crates/engine/src/commands/app_more.rs
index 9f6b7c99c..2a0056900 100644
--- a/crates/engine/src/commands/app_more.rs
+++ b/crates/engine/src/commands/app_more.rs
@@ -582,7 +582,15 @@ pub fn specs() -> Vec<CommandSpec> {
cmd!("edit.history", "History", [], None, "{steps?: n (undo n steps), redo?: n}", has_history, history),
cmd!("file.importRecent", "Import Recent Footage", [], None, "{index? | path?}", has_recent_footage, import_recent),
cmd!("file.clearRecentFootage", "Clear Recent Footage", ["File", "Import Recent Footage"], None, "{}", has_recent_footage, clear_recent_footage),
- cmd!("anim.applyRecentPreset", "Recent Animation Presets", [], None, "{index? | path?, layers?}", has_recent_presets, apply_recent_preset),
+ cmd!(
+ "anim.applyRecentPreset",
+ "Recent Animation Presets",
+ [],
+ Some("Cmd+Alt+Shift+F"),
+ "{index? | path?, layers?}",
+ has_recent_presets,
+ apply_recent_preset
+ ),
cmd!(
"anim.clearRecentPresets",
"Clear Recent Presets",
diff --git a/crates/engine/src/commands/edit.rs b/crates/engine/src/commands/edit.rs
index 7f134c6b9..d28f34129 100644
--- a/crates/engine/src/commands/edit.rs
+++ b/crates/engine/src/commands/edit.rs
@@ -863,7 +863,15 @@ pub fn specs() -> Vec<CommandSpec> {
has_comp,
paste_svg
),
- cmd!("edit.pasteReversedKeyframes", "Paste Reversed Keyframes", ["Edit"], None, "{layers?, prop?|path?, time?}", has_key_clip, paste_reversed),
+ cmd!(
+ "edit.pasteReversedKeyframes",
+ "Paste Reversed Keyframes",
+ ["Edit"],
+ Some("Cmd+Shift+V"),
+ "{layers?, prop?|path?, time?}",
+ has_key_clip,
+ paste_reversed
+ ),
cmd!("edit.clear", "Clear", ["Edit"], Some("Delete"), "{layers?}", layers_or_keys, delete),
cmd!("edit.duplicate", "Duplicate", ["Edit"], Some("Cmd+D"), "{layers?} (effects or shape items when they are selected)", has_layers, duplicate),
cmd!("edit.splitLayer", "Split Layer", ["Edit"], Some("Cmd+Shift+D"), "{layers?}", has_layers, split),
diff --git a/crates/engine/src/commands/proxy.rs b/crates/engine/src/commands/proxy.rs
index f05e97656..b7d644b94 100644
--- a/crates/engine/src/commands/proxy.rs
+++ b/crates/engine/src/commands/proxy.rs
@@ -221,7 +221,7 @@ pub fn specs() -> Vec<CommandSpec> {
has_comp_selection,
create_proxy
),
- cmd!("file.setProxy", "File...", ["File", "Set Proxy"], None, "{path, items?|item?}", has_targets, set_proxy),
+ cmd!("file.setProxy", "File...", ["File", "Set Proxy"], Some("Cmd+Alt+P"), "{path, items?|item?}", has_targets, set_proxy),
cmd!("file.setProxyNone", "None", ["File", "Set Proxy"], None, "{items?|item?}", has_proxy, set_proxy_none),
cmd!("file.useProxy", "Use Proxy", [], None, "{items?|item?, on?}", has_proxy, use_proxy),
cmd!(
diff --git a/crates/engine/src/commands/settings.rs b/crates/engine/src/commands/settings.rs
index 1a5789e28..a6621c3f4 100644
--- a/crates/engine/src/commands/settings.rs
+++ b/crates/engine/src/commands/settings.rs
@@ -283,7 +283,7 @@ pub fn specs() -> Vec<CommandSpec> {
cmd!("shortcuts.export", "Export Keyboard Shortcuts", [], None, "{preset?, path?}", always, sc_export),
cmd!("shortcuts.import", "Import Keyboard Shortcuts", [], None, "{path? | preset?: exported document, name?}", always, sc_import),
query!("shortcuts.conflicts", "Keyboard Shortcut Conflicts", "{}", sc_conflicts),
- cmd!("file.openRecent", "Open Recent", [], None, "{index? | path?}", has_recent, open_recent),
+ cmd!("file.openRecent", "Open Recent", [], Some("Cmd+Alt+Shift+P"), "{index? | path?}", has_recent, open_recent),
cmd!("file.clearRecent", "Clear Recent Projects", ["File", "Open Recent"], None, "{}", has_recent, clear_recent),
cmd!("file.autoSave", "Auto-Save Now", [], None, "{}", always, auto_save),
query!("file.recoveryInfo", "Auto-Save Status", "{}", recovery_info),
diff --git a/crates/engine/src/commands/view.rs b/crates/engine/src/commands/view.rs
index abf924169..a23bf618c 100644
--- a/crates/engine/src/commands/view.rs
+++ b/crates/engine/src/commands/view.rs
@@ -136,7 +136,15 @@ pub fn specs() -> Vec<CommandSpec> {
res!("view.res.half", "Half", ["View", "Resolution"], Some("Cmd+Shift+J"), Half),
res!("view.res.third", "Third", ["View", "Resolution"], None, Third),
res!("view.res.quarter", "Quarter", ["View", "Resolution"], Some("Cmd+Alt+Shift+J"), Quarter),
- cmd!("view.res.custom", "Custom...", ["View", "Resolution"], None, "{factor?: 1..40 (render every n-th pixel), comp?}", has_comp, custom_resolution),
+ cmd!(
+ "view.res.custom",
+ "Custom...",
+ ["View", "Resolution"],
+ Some("Cmd+Alt+J"),
+ "{factor?: 1..40 (render every n-th pixel), comp?}",
+ has_comp,
+ custom_resolution
+ ),
// The Composition panel's Resolution popup (not in the View menu).
res!("view.res.auto", "Resolution: Auto", [], None, Auto),
cmd!("view.layout", "Switch View Layout", [], None, "{views: 1|2|4}", has_comp, view_layout),
diff --git a/crates/engine/src/menus.rs b/crates/engine/src/menus.rs
index bd1cffb0a..5fedf7824 100644
--- a/crates/engine/src/menus.rs
+++ b/crates/engine/src/menus.rs
@@ -650,7 +650,7 @@ Edit
All 3D Cache... | edit.purge {"what":"3d"}
Undo | edit.purgeUndo
Image Cache Memory | edit.purge {"what":"image"}
- Snapshot | edit.purge {"what":"snapshot"}
+ Snapshot | edit.purge {"what":"snapshot"} | Cmd+Shift+F5
---
Edit Original... | edit.editOriginal
---
@@ -775,8 +775,8 @@ Layer
Draft | layer.quality {"quality":"draft"} | Cmd+Shift+U
Wireframe | layer.quality {"quality":"wireframe"} | Cmd+Alt+Shift+U
---
- Bilinear | layer.sampling {"sampling":"bilinear"}
- Bicubic | layer.sampling {"sampling":"bicubic"}
+ Bilinear | layer.sampling {"sampling":"bilinear"} | Alt+B
+ Bicubic | layer.sampling {"sampling":"bicubic"} | Alt+Shift+B
Switches
Hide Other Video | layer.hideOtherVideo
Show All Video | layer.showAllVideo
diff --git a/crates/engine/src/tests_settings.rs b/crates/engine/src/tests_settings.rs
index f072d4cc6..b425e098d 100644
--- a/crates/engine/src/tests_settings.rs
+++ b/crates/engine/src/tests_settings.rs
@@ -410,6 +410,26 @@ fn fast_previews_and_show_channel_modes_have_default_keys() {
assert_eq!(s.state.viewer.channel.id(), "rgb");
}
+/// Default keys for commands and menu entries that had none.
+#[test]
+fn default_keys_for_commands_that_had_none() {
+ let s = Session::default();
+ let t = s.shortcuts();
+ for (id, params, key) in [
+ ("edit.pasteReversedKeyframes", json!(null), "Cmd+Shift+V"),
+ ("edit.purge", json!({"what": "snapshot"}), "Cmd+Shift+F5"),
+ ("layer.sampling", json!({"sampling": "bilinear"}), "Alt+B"),
+ ("layer.sampling", json!({"sampling": "bicubic"}), "Alt+Shift+B"),
+ ("view.res.custom", json!(null), "Cmd+Alt+J"),
+ ("file.setProxy", json!(null), "Cmd+Alt+P"),
+ ("file.openRecent", json!(null), "Cmd+Alt+Shift+P"),
+ ("anim.applyRecentPreset", json!(null), "Cmd+Alt+Shift+F"),
+ ] {
+ assert_eq!(t.shortcut_of(id, &params), Some(key), "{id} {params}");
+ }
+ assert!(t.all_conflicts().is_empty(), "{:?}", t.all_conflicts());
+}
+
/// Cmd+Left / Cmd+Right Arrow step a frame like Page Up / Page Down (Shift: 10 frames).
#[test]
fn cmd_arrows_step_frames_like_page_keys() {
diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs
index b10b0e31c..a60e524a8 100644
--- a/crates/ui-egui/src/menus.rs
+++ b/crates/ui-egui/src/menus.rs
@@ -43,7 +43,7 @@ pub const UI_COMMANDS: &[UiCommand] = &[
uic!("viewer.nudge.down10", "Move Selected Layers Down 10 Pixels at Current Magnification", [], Some("Shift+ArrowDown")),
uic!("viewer.nudge.left10", "Move Selected Layers Left 10 Pixels at Current Magnification", [], Some("Shift+ArrowLeft")),
uic!("viewer.nudge.right10", "Move Selected Layers Right 10 Pixels at Current Magnification", [], Some("Shift+ArrowRight")),
- uic!("view.safeMargins", "Title/Action Safe", [], None),
+ uic!("view.safeMargins", "Title/Action Safe", [], Some("'")),
uic!("view.transparencyGrid", "Transparency Grid", [], None),
uic!("view.fastPreviews", "Fast Previews", [], None),
uic!("view.theme.toggle", "Next Appearance Mode", [], None),
@@ -52,7 +52,7 @@ pub const UI_COMMANDS: &[UiCommand] = &[
uic!("view.theme.light", "Theme: Light", [], None),
uic!("timeline.zoomIn", "Zoom In Time", [], Some("=")),
uic!("timeline.zoomOut", "Zoom Out Time", [], Some("-")),
- uic!("timeline.zoomFit", "Zoom to Fit Comp", [], None),
+ uic!("timeline.zoomFit", "Zoom to Fit Comp", [], Some("Shift+;")),
uic!("timeline.zoomFrameToggle", "Zoom In to Frame Level / Out to the Whole Comp", [], Some(";")),
uic!("timeline.graphEditor", "Graph Editor", [], Some("Shift+F3")),
uic!("timeline.switchesModes", "Toggle Switches / Modes", [], Some("F4")),