Crate key_names

Source
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 csam for CTRL, SHIFT, ALT, and META/LOGO respectively 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.