[fix] Map Mac keyboard geometry so ISO keycaps match in the guest - #190
Open
jean-humann wants to merge 1 commit into
Open
[fix] Map Mac keyboard geometry so ISO keycaps match in the guest#190jean-humann wants to merge 1 commit into
jean-humann wants to merge 1 commit into
Conversation
jean-humann
force-pushed
the
fix/mac-keyboard-geometry
branch
from
September 11, 2026 12:17
6025202 to
25398f8
Compare
jean-humann
force-pushed
the
fix/mac-keyboard-geometry
branch
2 times, most recently
from
September 11, 2026 12:51
a8a603d to
24074e0
Compare
Detect ANSI/ISO/JIS once in omarchy-vm-helper, fail closed on unknown classes, and feed the same value to Cocoa and tryomarchy.keyboard= so ISO Section/Grave keycodes match guest applealu_* models. Related to omacom#67. Co-authored-by: Cursor <cursoragent@cursor.com>
jean-humann
force-pushed
the
fix/mac-keyboard-geometry
branch
from
September 11, 2026 13:29
24074e0 to
3d686d2
Compare
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.
Summary
Mac ISO keyboards deliver Linux
KEY_GRAVEandKEY_102NDswapped through Cocoa, so@#and<>land on the wrong keys in the guest (#67). Omarchy setupFrench|fris PCfr, so even correct keycodes show²above Tab.This detects ANSI / ISO / JIS once in the compiled
omarchy-vm-helperand fails the launch on an unknown Carbon class. The same value is exported asTRYOMARCHY_KEYBOARDand appended astryomarchy.keyboard=. QEMU Cocoa swaps those keycodes only when the env isiso. Recovery QEMU unsets the env and does not append the token. The guest sets onlykb_model=applealu_*. Macintosh legends apply to xkeyboard-config Mac vendor layouts (ch de dk fi fr gb is it latam nl no pt se us) with an empty variant; the ISO keycode correction applies to every layout.On an M3 Pro French AZERTY ISO host, a factory guest built from this branch (lock used locally, not committed) applied
kb_model=applealu_isowith nofrmac. Physical above-Tab typed@/#and the extra ISO key typed</>.The runtime patch is checksum-pinned and applies after the existing Cocoa series. The upstream QEMU pin is unchanged (
qemu_commit=c3d48b7d1e89604920e5b81b91140c2ad39a1943). Review the hash againstmacos/build-qemu-gpu-runtime.sh(iso_swap_patch_sha256):Expected:
57f33a5fb08fb90a7813b13bb7037a13198e4d7db230085b1faa28b284cf2387.See
docs/mac-keyboard.md.Existing VMs
App upgrade applies the Cocoa keycode swap immediately. That uninverts ISO
@#/<>withoutkb_model. Remove any localfrmacTLDE/LSGT workaround or those keys invert again. Macintosh legends needkb_model:dofilethe overlay if a rebuilt image installed it, otherwise paste thehl.configsnippet indocs/mac-keyboard.md. Do notdofilea missing path.Test plan
On an Apple Silicon M3 Pro (French AZERTY ISO),
3d686d2:iso_swap_patch_sha256; QEMU pin unchangedmake doctor/make test(Lua guest test + compiled ISO swap)make runtime— ISO patch applied last; stagedmacos/.build/qemu-gpu-runtime;TRYOMARCHY_KEYBOARDin QEMUomarchy-vm-helper --host-keyboard-geometryprintsisodofilepresentTRYOMARCHY_KEYBOARD=iso,tryomarchy.keyboard=iso,kb_layout=fr,kb_model=applealu_iso, nofrmac@/#; next to left Shift →</>; keys do not invertfrmacafter upgradeRelated to #67.