Expand description
Platform-aware keyboard key name handling for Rust applications.
Constants§
- ALT_STR
- OS’s conventional name for the
Alt modifier. - CTRL_
STR - OS’s conventional name for the
Ctrl modifier. - LOGO_
STR - OS’s conventional name for the logo modifier.
- MODIFIERS_
ORDER - OS’s conventional modifiers order, represented as an ASCII string containing
the characters
csamforCTRL,SHIFT,ALT, andMETA/LOGOrespectively in some order. - SHIFT_
STR - OS’s conventional name for the
Shift modifier.
Functions§
- key_
name - Returns a human-friendly name for a virtual key.
- mods_
prefix_ string - 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
- physical_
key_ name - Returns a human-friendly name for a physical key using the operating system’s API when possible.