gpui: Fix incorrect handling of Function key modifier on macOS#38518
Merged
mikayla-maki merged 1 commit intozed-industries:mainfrom Nov 5, 2025
Merged
gpui: Fix incorrect handling of Function key modifier on macOS#38518mikayla-maki merged 1 commit intozed-industries:mainfrom
mikayla-maki merged 1 commit intozed-industries:mainfrom
Conversation
mikayla-maki
requested changes
Oct 16, 2025
| } | ||
| } | ||
|
|
||
| #[cfg(target_os = "macos")] |
Member
There was a problem hiding this comment.
I don't think we want to remove the ability to respond to Fn keys at all, both Zed and Chrome use a function key binding to enable full screen on macOS.
582bfd9 to
8c5a61b
Compare
Contributor
Author
|
I updated this PR to only include some minimal changes. Now we only make sure |
On macOS, the Function key should not affect text inputs. This commit updated the key event handling to ignore the Function key modifier while users are typing.
8c5a61b to
4957659
Compare
mikayla-maki
approved these changes
Nov 5, 2025
Member
mikayla-maki
left a comment
There was a problem hiding this comment.
Given that this PR brings our behavior more inline with other macOS apps, and that this PR doesn't affect the behavior of our own fn-fkeybinding or macOS' cmd-` keybinding, let's get it merged.
Thanks!
3 tasks
maxbrunsfeld
pushed a commit
that referenced
this pull request
Nov 6, 2025
On macOS, the Function key is reserved for system use and should not be used in application code. This commit updated keystroke matching and key event handling to ignore the Function key modifier while users are typing or pressing keybindings. For some keyboards with compact layout (like my 65% keyboard), there is no separated backtick key. Esc and it shares the same physical key. To input backtick, users may press `Fn-Esc`. However, macOS will still deliver events with Fn key modifier to applications. Cocoa framework can handle this correctly, which typically ignore the Fn directly. GPUI should also follow the same rule, otherwise, the backtick key on those keyboards won't work. Release Notes: - Fixed a bug where typing fn-\` on macOS would not insert a `.
maxbrunsfeld
pushed a commit
that referenced
this pull request
Nov 6, 2025
On macOS, the Function key is reserved for system use and should not be used in application code. This commit updated keystroke matching and key event handling to ignore the Function key modifier while users are typing or pressing keybindings. For some keyboards with compact layout (like my 65% keyboard), there is no separated backtick key. Esc and it shares the same physical key. To input backtick, users may press `Fn-Esc`. However, macOS will still deliver events with Fn key modifier to applications. Cocoa framework can handle this correctly, which typically ignore the Fn directly. GPUI should also follow the same rule, otherwise, the backtick key on those keyboards won't work. Release Notes: - Fixed a bug where typing fn-\` on macOS would not insert a `.
tomatitito
pushed a commit
to tomatitito/zed
that referenced
this pull request
Nov 7, 2025
…ndustries#38518) On macOS, the Function key is reserved for system use and should not be used in application code. This commit updated keystroke matching and key event handling to ignore the Function key modifier while users are typing or pressing keybindings. For some keyboards with compact layout (like my 65% keyboard), there is no separated backtick key. Esc and it shares the same physical key. To input backtick, users may press `Fn-Esc`. However, macOS will still deliver events with Fn key modifier to applications. Cocoa framework can handle this correctly, which typically ignore the Fn directly. GPUI should also follow the same rule, otherwise, the backtick key on those keyboards won't work. Release Notes: - Fixed a bug where typing fn-\` on macOS would not insert a `.
11happy
pushed a commit
to 11happy/zed
that referenced
this pull request
Dec 1, 2025
…ndustries#38518) On macOS, the Function key is reserved for system use and should not be used in application code. This commit updated keystroke matching and key event handling to ignore the Function key modifier while users are typing or pressing keybindings. For some keyboards with compact layout (like my 65% keyboard), there is no separated backtick key. Esc and it shares the same physical key. To input backtick, users may press `Fn-Esc`. However, macOS will still deliver events with Fn key modifier to applications. Cocoa framework can handle this correctly, which typically ignore the Fn directly. GPUI should also follow the same rule, otherwise, the backtick key on those keyboards won't work. Release Notes: - Fixed a bug where typing fn-\` on macOS would not insert a `.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS, the Function key is reserved for system use and should not be used in application code.
This commit updated keystroke matching and key event handling to ignore the Function key modifier while users are typing or pressing keybindings.
For some keyboards with compact layout (like my 65% keyboard), there is no separated backtick key. Esc and it shares the same physical key. To input backtick, users may press
Fn-Esc. However, macOS will still deliver events with Fn key modifier to applications. Cocoa framework can handle this correctly, which typically ignore the Fn directly. GPUI should also follow the same rule, otherwise, the backtick key on those keyboards won't work.Release Notes: