fix OS keymapping issue with modals

Need to defer to the second pass (when we have mapped from physical
keys) before we route the key event to the modal.

refs: https://github.com/wez/wezterm/issues/3470
This commit is contained in:
Wez Furlong committed 2023-04-08 15:31:48 -07:00
1 parent f535c5bdc0
commit b9b0f36692
2 files changed
+16 -9

No files matched your search

+5
View File
@@ -21,6 +21,11 @@ usually the best available version.
As features stabilize some brief notes about them will accumulate here.
#### Fixed
* Modals, such as `CharSelect` and `CommandPalette` did not respect alternative
OS-level key maps. #3470
### 20230408-112425-69ae8472
#### Changed
+11 -9
View File
@@ -287,15 +287,17 @@ impl super::TermWindow {
}
if is_down {
if let Some(modal) = self.get_modal() {
if let Key::Code(term_key) = self.win_key_code_to_termwiz_key_code(keycode) {
let tw_raw_modifiers = window_mods_to_termwiz_mods(raw_modifiers);
match modal.key_down(term_key, tw_raw_modifiers, self) {
Ok(true) => return true,
Ok(false) => {}
Err(err) => {
log::error!("Error dispatching key to modal: {err:#}");
return true;
if only_key_bindings == OnlyKeyBindings::No {
if let Some(modal) = self.get_modal() {
if let Key::Code(term_key) = self.win_key_code_to_termwiz_key_code(keycode) {
let tw_raw_modifiers = window_mods_to_termwiz_mods(raw_modifiers);
match modal.key_down(term_key, tw_raw_modifiers, self) {
Ok(true) => return true,
Ok(false) => {}
Err(err) => {
log::error!("Error dispatching key to modal: {err:#}");
return true;
}
}
}
}