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:
2 files changed
+16
-9
No files matched your search
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user