Skip to main content

ratatui_toolkit/master_layout/keybindings/methods/
is_quit.rs

1//! is_quit method for MasterLayoutKeyBindings
2
3use crate::master_layout::keybindings::MasterLayoutKeyBindings;
4use crossterm::event::KeyEvent;
5
6impl MasterLayoutKeyBindings {
7    /// Check if the given key event matches any of the quit keys
8    pub fn is_quit(&self, key: &KeyEvent) -> bool {
9        self.quit
10            .iter()
11            .any(|(code, mods)| key.code == *code && key.modifiers == *mods)
12    }
13}