Skip to content

Commit

Permalink
Show alt key on mac as "Option", not "Alt" (#2981)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf authored May 10, 2023
1 parent e9fa6c8 commit 268a63f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/egui/src/data/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ pub struct ModifierNames<'a> {
pub ctrl: &'a str,
pub shift: &'a str,
pub mac_cmd: &'a str,
pub mac_alt: &'a str,

/// What goes between the names
pub concat: &'a str,
Expand All @@ -547,6 +548,7 @@ impl ModifierNames<'static> {
ctrl: "^",
shift: "⇧",
mac_cmd: "⌘",
mac_alt: "⌥",
concat: "",
};

Expand All @@ -557,6 +559,7 @@ impl ModifierNames<'static> {
ctrl: "Ctrl",
shift: "Shift",
mac_cmd: "Cmd",
mac_alt: "Option",
concat: "+",
};
}
Expand All @@ -577,7 +580,7 @@ impl<'a> ModifierNames<'a> {
if is_mac {
append_if(modifiers.ctrl, self.ctrl);
append_if(modifiers.shift, self.shift);
append_if(modifiers.alt, self.alt);
append_if(modifiers.alt, self.mac_alt);
append_if(modifiers.mac_cmd || modifiers.command, self.mac_cmd);
} else {
append_if(modifiers.ctrl || modifiers.command, self.ctrl);
Expand Down

0 comments on commit 268a63f

Please sign in to comment.