Repository navigation
Fix zoom shortcuts on non-US keyboard layouts - #1406
Merged
Merged
Conversation
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.
Related to #861.
Modifier-key scrolling can zoom out but fail to zoom in on layouts such as Czech, Hungarian, and Swiss. The existing implementation always sends Command with the numeric keypad plus or minus key, which does not consistently match the application's localized shortcuts.
Use a detached NSMenu to resolve the keycodes and modifiers AppKit accepts for Command-plus and Command-minus. Resolve on the main thread and cache the results for scrolling, invalidating them when the input source changes. This avoids switching keyboard layouts or matching localized menu titles.
Skip shortcuts reserved by macOS and restore the original modifier state after each simulated shortcut, including releasing a temporary Shift modifier. Preserve the existing behavior on macOS versions before 12.
Validation:
make testpassed, including all 927 app tests.make lintpassed with existing warnings.The approach was validated with a prototype across seven keyboard layouts in Chrome, Safari, and Firefox on macOS 27 beta. The integrated implementation passes automated tests; validation on the originally affected environments is still pending.