pub trait KeyboardHook: Send + Sync {
// Provided methods
fn on_key_pressed(&mut self, _key: &KeyEvent) -> KeyboardHookResult { ... }
fn on_key_combo(&mut self, _combo: &KeyCombo) -> KeyboardHookResult { ... }
}Expand description
Hook for intercepting keyboard events.
Provided Methods§
Sourcefn on_key_pressed(&mut self, _key: &KeyEvent) -> KeyboardHookResult
fn on_key_pressed(&mut self, _key: &KeyEvent) -> KeyboardHookResult
Called when a key is pressed.
Return KeyboardHookResult::Handled to prevent the default handler.
Sourcefn on_key_combo(&mut self, _combo: &KeyCombo) -> KeyboardHookResult
fn on_key_combo(&mut self, _combo: &KeyCombo) -> KeyboardHookResult
Called when a key combination is pressed (e.g., Ctrl+S).