From ba6a8e3b7d41959fbb7811f98e3bc1af444c2d16 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Mon, 13 Jan 2025 09:21:44 -0700 Subject: [PATCH] Exclude function keys from input handler Fixes #22674 --- crates/gpui/src/platform/mac/window.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs index 04fda6294a0ae1..dc715a071b5367 100644 --- a/crates/gpui/src/platform/mac/window.rs +++ b/crates/gpui/src/platform/mac/window.rs @@ -1258,7 +1258,12 @@ extern "C" fn handle_key_event(this: &Object, native_event: id, key_equivalent: // We also do this for non-printing keys (like arrow keys and escape) as the IME menu // may need them even if there is no marked text; // however we skip keys with control or the input handler adds control-characters to the buffer. - if is_composing || (event.keystroke.key_char.is_none() && !event.keystroke.modifiers.control) { + // and keys with function, as the input handler swallows them. + if is_composing + || (event.keystroke.key_char.is_none() + && !event.keystroke.modifiers.control + && !event.keystroke.modifiers.function) + { { let mut lock = window_state.as_ref().lock(); lock.keystroke_for_do_command = Some(event.keystroke.clone());