Skip to main content

key_event_to_canonical_chord_string

Function key_event_to_canonical_chord_string 

Source
pub fn key_event_to_canonical_chord_string(
    code: KeyCode,
    mods: KeyModifiers,
) -> Option<String>
Expand description

What: Serialize a raw key event into the canonical chord string used by the keybind parser, for the popup’s capture mode.

Inputs:

  • code: Crossterm key code from the captured event.
  • mods: Modifier flags from the captured event.

Output:

  • Some(chord) such as "Ctrl+r" or "Shift+Tab" when the key is representable in keybinds.conf; None for unsupported codes (media keys, bare modifier presses, etc.), which capture mode should ignore rather than record.