Skip to main content

chord_to_canonical_string

Function chord_to_canonical_string 

Source
pub fn chord_to_canonical_string(chord: &KeyChord) -> String
Expand description

What: Serialize a KeyChord into the canonical string format understood by theme::parsing::parse_key_chord.

Inputs:

  • chord: Chord to serialize.

Output:

  • String such as "Ctrl+R", "Shift+Tab", "F5", "Up", or "Space".

Details:

  • KeyChord::label() formats arrow keys as Unicode glyphs which the parser does not accept; this helper outputs ASCII tokens that round-trip.
  • BackTab is rendered as "Shift+Tab" to match the parser’s special case.