mods_prefix_string

Function mods_prefix_string 

Source
pub fn mods_prefix_string(
    shift: bool,
    ctrl: bool,
    alt: bool,
    logo: bool,
) -> String
Expand description

Returns a string representing modifiers using the OS’s conventional names and ordering. For example, on Windows this function might produce “Ctrl + Shift + Alt + Win + “ while on macOS it might produce “Ctrl + Option + Shift

  • Cmd + “.
Examples found in repository?
examples/all_keys.rs (line 15)
4fn main() {
5    for &key in ALL_KEYS {
6        println!(
7            "{:>30} -> {}",
8            format!("{key:?}"),
9            physical_key_name(PhysicalKey::Code(key)),
10        );
11    }
12    println!();
13    println!(
14        "Modifiers: {}<key>",
15        mods_prefix_string(true, true, true, true),
16    );
17}