1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 13:21:38 +03:00

gui: show LEADER status in debug_key_events logging

This commit is contained in:
Wez Furlong 2022-04-25 07:32:39 -07:00
parent 9fe9c94b5d
commit f1d96b2d19

View File

@ -264,12 +264,6 @@ impl super::TermWindow {
}
pub fn raw_key_event_impl(&mut self, key: RawKeyEvent, context: &dyn WindowOps) {
if self.config.debug_key_events {
log::info!("key_event {:?}", key);
} else {
log::trace!("key_event {:?}", key);
}
// The leader key is a kind of modal modifier key.
// It is allowed to be active for up to the leader timeout duration,
// after which it auto-deactivates.
@ -280,6 +274,20 @@ impl super::TermWindow {
(false, Modifiers::NONE)
};
if self.config.debug_key_events {
log::info!(
"key_event {:?} {}",
key,
if leader_active { "LEADER" } else { "" }
);
} else {
log::trace!(
"key_event {:?} {}",
key,
if leader_active { "LEADER" } else { "" }
);
}
let pane = match self.get_active_pane_or_overlay() {
Some(pane) => pane,
None => return,
@ -394,12 +402,6 @@ impl super::TermWindow {
}
pub fn key_event_impl(&mut self, window_key: KeyEvent, context: &dyn WindowOps) {
if self.config.debug_key_events {
log::info!("key_event {:?}", window_key);
} else {
log::trace!("key_event {:?}", window_key);
}
let pane = match self.get_active_pane_or_overlay() {
Some(pane) => pane,
None => return,
@ -415,6 +417,20 @@ impl super::TermWindow {
(false, Modifiers::NONE)
};
if self.config.debug_key_events {
log::info!(
"key_event {:?} {}",
window_key,
if leader_active { "LEADER" } else { "" }
);
} else {
log::trace!(
"key_event {:?} {}",
window_key,
if leader_active { "LEADER" } else { "" }
);
}
let modifiers = window_mods_to_termwiz_mods(window_key.modifiers);
if self.process_key(