From 80fcedbf9200848a54e1d16edada6679379ac10b Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 22 Apr 2022 22:43:48 -0700 Subject: [PATCH] window: macos: remove on horrible keyboard hack We can synthesize the key down for ctrl-tab in perform_key_equivalent, so let's do that! --- window/src/os/macos/window.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/window/src/os/macos/window.rs b/window/src/os/macos/window.rs index a8c4a9b64..337f6d1b9 100644 --- a/window/src/os/macos/window.rs +++ b/window/src/os/macos/window.rs @@ -1995,19 +1995,6 @@ impl WindowView { key_is_down ); - // Ungh, this is a horrible special case. - // 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 - && modifiers.contains(Modifiers::CTRL) - && !key_is_down - { - true - } else { - key_is_down - }; - // `Delete` on macos is really Backspace and emits BS. // `Fn-Delete` emits DEL. // Alt-Delete is mapped by the IME to be equivalent to Fn-Delete. @@ -2344,6 +2331,7 @@ impl WindowView { if (chars == "." && modifiers == Modifiers::SUPER) || (chars == "\u{1b}" && modifiers == Modifiers::CTRL) + || (chars == "\t" && modifiers == Modifiers::CTRL) { // Synthesize a key down event for this, because macOS will // not do that, even though we tell it that we handled this event.