mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-03 06:52:21 -06:00
Merge pull request #1109 from eliasx45/upstream/azerty-graph-zoom
# Conflicts: # crates/engine/src/commands/time.rs # crates/ui-egui/src/panels/timeline.rs
This commit is contained in:
@@ -151,6 +151,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),
|
||||
@@ -177,6 +178,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,
|
||||
@@ -188,7 +190,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);
|
||||
|
||||
Reference in New Issue
Block a user