Guide API
Skip to main content

is_plain_hotkey

Function is_plain_hotkey 

Source
pub fn is_plain_hotkey(ke: &KeyEvent, hot: char) -> bool
Expand description

Test whether a key event is a plain (non-modified) hotkey press.

Returns true iff:

  • neither alt nor ctrl is held, and
  • ke.key is Key::Char(c) where c matches hot case-insensitively.

Why !alt && !ctrl is required: in the decomposed key model Ctrl+S is Key::Char('s') + ctrl, so omitting the ctrl check would let is_plain_hotkey(Ctrl+S, 'S') false-match. Since Ctrl makes is_alt_hotkey false, the call falls through to this predicate, so guarding both modifiers is what keeps a plain-letter press distinct from a modified one. Callers still own the phase gate (post-process / focused), not this helper.