Skip to content

Commit

Permalink
Exclude function keys from input handler
Browse files Browse the repository at this point in the history
Fixes #22674
  • Loading branch information
ConradIrwin committed Jan 13, 2025
1 parent 955248f commit ba6a8e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/gpui/src/platform/mac/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit ba6a8e3

Please sign in to comment.