fn format_hotkey(key: &HotKey, s: &mut String) {
    let key_mods: Modifiers = key.mods.into();
    if key_mods.ctrl() {
        s.push_str("Ctrl+");
    }
    if key_mods.shift() {
        s.push_str("Shift+");
    }
    if key_mods.alt() {
        s.push_str("Alt+");
    }
    if key_mods.meta() {
        s.push_str("Windows+");
    }
    match &key.key {
        KbKey::Character(c) => match c.as_str() {
            "+" => s.push_str("Plus"),
            "-" => s.push_str("Minus"),
            " " => s.push_str("Space"),
            _ => s.extend(c.chars().flat_map(|c| c.to_uppercase())),
        },
        KbKey::Escape => s.push_str("Esc"),
        KbKey::Delete => s.push_str("Del"),
        KbKey::Insert => s.push_str("Ins"),
        KbKey::PageUp => s.push_str("PgUp"),
        KbKey::PageDown => s.push_str("PgDn"),
        // These names match LibreOffice.
        KbKey::ArrowLeft => s.push_str("Left"),
        KbKey::ArrowRight => s.push_str("Right"),
        KbKey::ArrowUp => s.push_str("Up"),
        KbKey::ArrowDown => s.push_str("Down"),
        _ => s.push_str(&format!("{:?}", key.key)),
    }
}
/// Format the hotkey in a Windows-native way.
Format the hotkey in a Windows-native way.
Format the hotkey in a Windows - native way .
fn format_hotkey(key: &HotKey, s: &mut String) {
    let key_mods: Modifiers = key.mods.into();
    if key_mods.ctrl() {
        s.push_str("Ctrl+");
    }
    if key_mods.shift() {
        s.push_str("Shift+");
    }
    if key_mods.alt() {
        s.push_str("Alt+");
    }
    if key_mods.meta() {
        s.push_str("Windows+");
    }
    match &key.key {
        KbKey::Character(c) => match c.as_str() {
            "+" => s.push_str("Plus"),
            "-" => s.push_str("Minus"),
            " " => s.push_str("Space"),
            _ => s.extend(c.chars().flat_map(|c| c.to_uppercase())),
        },
        KbKey::Escape => s.push_str("Esc"),
        KbKey::Delete => s.push_str("Del"),
        KbKey::Insert => s.push_str("Ins"),
        KbKey::PageUp => s.push_str("PgUp"),
        KbKey::PageDown => s.push_str("PgDn"),
        // These names match LibreOffice.
        KbKey::ArrowLeft => s.push_str("Left"),
        KbKey::ArrowRight => s.push_str("Right"),
        KbKey::ArrowUp => s.push_str("Up"),
        KbKey::ArrowDown => s.push_str("Down"),
        _ => s.push_str(&format!("{:?}", key.key)),
    }
}
fn format_hotkey ( key : & HotKey , s : & mut String ) { let key_mods : Modifiers = key . mods . into ( ) ; if key_mods . ctrl ( ) { s . push_str ( " " ) ; } if key_mods . shift ( ) { s . push_str ( " " ) ; } if key_mods . alt ( ) { s . push_str ( " " ) ; } if key_mods . meta ( ) { s . push_str ( " " ) ; } match & key . key { KbKey :: Character ( c ) => match c . as_str ( ) { " " => s . push_str ( " " ) , " " => s . push_str ( " " ) , " " => s . push_str ( " " ) , _ => s . extend ( c . chars ( ) . flat_map ( | c | c . to_uppercase ( ) ) ) , } , KbKey :: Escape => s . push_str ( " " ) , KbKey :: Delete => s . push_str ( " " ) , KbKey :: Insert => s . push_str ( " " ) , KbKey :: PageUp => s . push_str ( " " ) , KbKey :: PageDown => s . push_str ( " " ) , // These names match LibreOffice. KbKey :: ArrowLeft => s . push_str ( " " ) , KbKey :: ArrowRight => s . push_str ( " " ) , KbKey :: ArrowUp => s . push_str ( " " ) , KbKey :: ArrowDown => s . push_str ( " " ) , _ => s . push_str ( & format ! ( " " key key ) ) , } }
Format the hotkey in a Windows-native way.
Format the hotkey in a Windows - native way .
key
&HotKey
s
&mut String
key
&HotKey
s
&mut String