mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 08:51:14 -03:00
key: Add super modifier
Fixes #11217
(cherry picked from commit 9f5e1736a8)
This commit is contained in:
@@ -560,6 +560,7 @@ pub(crate) fn terminal_protocols_disable_ifn() {
|
||||
|
||||
fn parse_mask(mask: u32) -> Modifiers {
|
||||
Modifiers {
|
||||
sup: (mask & 8) != 0,
|
||||
ctrl: (mask & 4) != 0,
|
||||
alt: (mask & 2) != 0,
|
||||
shift: (mask & 1) != 0,
|
||||
|
||||
@@ -54,6 +54,7 @@ pub struct Modifiers {
|
||||
pub ctrl: bool,
|
||||
pub alt: bool,
|
||||
pub shift: bool,
|
||||
pub sup: bool,
|
||||
}
|
||||
|
||||
impl Modifiers {
|
||||
@@ -62,6 +63,7 @@ const fn new() -> Self {
|
||||
ctrl: false,
|
||||
alt: false,
|
||||
shift: false,
|
||||
sup: false,
|
||||
}
|
||||
}
|
||||
pub(crate) const ALT: Self = {
|
||||
@@ -271,6 +273,7 @@ pub(crate) fn parse_keys(value: &wstr) -> Result<Vec<Key>, WString> {
|
||||
_ if modifier == "ctrl" => modifiers.ctrl = true,
|
||||
_ if modifier == "alt" => modifiers.alt = true,
|
||||
_ if modifier == "shift" => modifiers.shift = true,
|
||||
_ if modifier == "super" => modifiers.sup = true,
|
||||
_ => {
|
||||
return Err(wgettext_fmt!(
|
||||
"unknown modifier '%s' in '%s'",
|
||||
@@ -407,6 +410,9 @@ fn from(key: Key) -> Self {
|
||||
if key.modifiers.ctrl {
|
||||
res.insert_utfstr(0, L!("ctrl-"));
|
||||
}
|
||||
if key.modifiers.sup {
|
||||
res.insert_utfstr(0, L!("super-"));
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user