Skip to content

Fix zoom shortcuts on non-US keyboard layouts - #1406

Merged
lujjjh merged 1 commit into
mainfrom
fix/layout-aware-zoom
Sep 24, 2026
Merged

lujjjh merged 1 commit into
mainfrom
fix/layout-aware-zoom

Conversation

@lujjjh

@lujjjh lujjjh commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

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 test passed, including all 927 app tests.
  • KeyKit: 19 tests passed; 3 tests that post real system events were skipped.
  • make lint passed 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.

@lujjjh lujjjh added the bug Something isn't working label Sep 24, 2026
@lujjjh
lujjjh merged commit 9a9889d into main Sep 24, 2026
1 check passed
@lujjjh
lujjjh deleted the fix/layout-aware-zoom branch September 24, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant