shortcuts: physical-key bindings for AZERTY layouts; Go to Work Area Start/End

Shortcut presets accept Physical+<key> (egui US-position names) so layouts that report the
same logical key for two physical keys (AZERTY's - and )) can bind them separately; physical
bindings win for that press, and a focused panel's binding wins over an application command on
the same chord. ui.key accepts the same notation. Adds time.workAreaStart / time.workAreaEnd.

(cherry picked from commit 209543e9e0ba32f809f9ff333abb8b8ec4125cea)

(cherry picked from commit f8301a9e3e0b60e200e8a233455398741658481e)
(cherry picked from commit 4d002fabf992934e1bb73a0c32bc9f3fd3ae5447)

(cherry picked from commit 5d466c5955ee934d5347c194ec7d15fb5f58bba4)
This commit is contained in:
Elias
2026-10-12 19:21:40 +01:00
committed by Elias
parent 470ea7a3af
commit 0553180092
6 changed files with 130 additions and 14 deletions
+2
View File
@@ -180,6 +180,8 @@ pub fn specs() -> Vec<CommandSpec> {
cmd!("time.step", "Step Frames", [], None, "{frames}", has_comp, step),
cmd!("time.start", "Go to Start", [], Some("Home"), "{}", has_comp, |s, _| go(s, &json!({"to": "start"}))),
cmd!("time.end", "Go to End", [], Some("End"), "{}", has_comp, |s, _| go(s, &json!({"to": "end"}))),
cmd!("time.workAreaStart", "Go to Work Area Start", [], None, "{}", has_comp, |s, _| go(s, &json!({"to": "workStart"}))),
cmd!("time.workAreaEnd", "Go to Work Area End", [], None, "{}", has_comp, |s, _| go(s, &json!({"to": "workEnd"}))),
cmd!("time.layerIn", "Go to Layer In Point", [], Some("I"), "{}", has_comp, |s, _| go(s, &json!({"to": "layerIn"}))),
cmd!("time.layerOut", "Go to Layer Out Point", [], Some("O"), "{}", has_comp, |s, _| go(s, &json!({"to": "layerOut"}))),
cmd!(
+3 -1
View File
@@ -150,6 +150,7 @@ pub fn normalize(s: &str) -> Option<String> {
}
let (mut ctrl, mut cmd, mut alt, mut shift) = (false, false, false, false);
let mut key: Option<String> = None;
let mut physical = false;
// `Cmd++` / `+` name the plus key.
let (head, plus) = match s.strip_suffix("++") {
Some(h) => (h, true),
@@ -176,6 +177,7 @@ pub fn normalize(s: &str) -> Option<String> {
}
for p in parts {
match p.to_ascii_lowercase().as_str() {
"physical" => physical = true,
"cmd" | "command" | "meta" | "super" | "win" => cmd = true,
"ctrl" | "control" => ctrl = true,
"alt" | "opt" | "option" => alt = true,
@@ -187,7 +189,7 @@ pub fn normalize(s: &str) -> Option<String> {
key = Some("+".into());
}
let key = key?;
let mut out = String::new();
let mut out = if physical { "Physical+".to_string() } else { String::new() };
for (on, m) in [(ctrl, "Ctrl+"), (cmd, "Cmd+"), (alt, "Alt+"), (shift, "Shift+")] {
if on {
out.push_str(m);