From a4b68247bbb5e88558f6b0b2a2c47840ca5e9d1d Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 15 Apr 2022 20:51:01 -0700 Subject: [PATCH] window: fix CTRL-[ on macos This is another key combination that doesn't generate a key-down event. refs: https://github.com/wez/wezterm/issues/1877 --- window/src/os/macos/window.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/window/src/os/macos/window.rs b/window/src/os/macos/window.rs index 38e0d3694..525b8b76b 100644 --- a/window/src/os/macos/window.rs +++ b/window/src/os/macos/window.rs @@ -1997,7 +1997,10 @@ impl WindowView { // CTRL-Tab only delivers a key-up event, and never a // key-down event. So we just pretend that key-up is // key-down. - let key_is_down = if virtual_key == super::keycodes::kVK_Tab + // Same for CTRL-[ + // + let key_is_down = if (virtual_key == super::keycodes::kVK_Tab + || virtual_key == super::keycodes::kVK_ANSI_LeftBracket) && modifiers.contains(Modifiers::CTRL) && !key_is_down {