Skip to main content

special_label

Function special_label 

Source
pub fn special_label(k: SpecialKey) -> &'static str
Expand description

Canonical name for a SpecialKey. Round-trips through parse_special. Renderer-neutral text; both the TUI’s format_chord and any future GPUI describe-key renderer use this label.

The one exception to the round-trip: F13..=F24 (and the invalid F(0)) all render as "F?", although the parser accepts <F13>..<F24>.

§Examples

use lattice_protocol::{SpecialKey, special_label};

assert_eq!(special_label(SpecialKey::Enter), "CR");
assert_eq!(special_label(SpecialKey::F(5)), "F5");