Replicating the full macOS ABC Extended Keyboard with XKB
June 5, 2025 • 3 min read
With the help of AI, of course.
In the previous post I created a fix for some of the missing dead keys in the us(mac)
layout I use on NixOS
Today I thought, why not simply replicate the entire layout?
A quick search (with ChatGPT) gave me this great resource with an entire spec for the ABC Extended layout.
It was only a matter of giving ChatGPT an example and telling it to convert everything to xkb. Here’s the result, althought I haven’t actually tested every single case:
default partial default alphanumeric_keys
xkb_symbols "extended" {
name[Group1]= "ABC Extended (macOS)";
key.type[group1]="FOUR_LEVEL";
// Numbers row
key <TLDE> { [ grave, asciitilde, dead_grave, dead_horn ] };
key <AE01> { [ 1, exclam, exclamdown, U2044 ] };
key <AE02> { [ 2, at, trademark, EuroSign ] };
key <AE03> { [ 3, numbersign, sterling, U2039 ] };
key <AE04> { [ 4, dollar, cent, U203A ] };
key <AE05> { [ 5, percent, section, U2020 ] };
key <AE06> { [ 6, asciicircum, dead_circumflex, U0302 ] };
key <AE07> { [ 7, ampersand, paragraph, U2021 ] };
key <AE08> { [ 8, asterisk, bullet, degree ] };
key <AE09> { [ 9, parenleft, ordfeminine, periodcentered ] };
key <AE10> { [ 0, parenright, masculine, U201A ] };
key <AE11> { [ minus, underscore, endash, emdash ] };
key <AE12> { [ equal, plus, notequal, plusminus ] };
// QWERTY row
key <AD01> { [ q, Q, oe, OE ] };
key <AD02> { [ w, W, dead_abovedot, U0307 ] };
key <AD03> { [ e, E, dead_acute, U0301 ] };
key <AD04> { [ r, R, registered, permille ] };
key <AD05> { [ t, T, thorn, THORN ] };
key <AD06> { [ y, Y, yen, U030F ] };
key <AD07> { [ u, U, dead_diaeresis, U0308 ] };
key <AD08> { [ i, I, dead_horn, U031B ] };
key <AD09> { [ o, O, Oslash, Oslash ] };
key <AD10> { [ p, P, dead_belowcomma, U0326 ] };
key <AD11> { [ bracketleft, braceleft, leftdoublequotemark, rightdoublequotemark ] };
key <AD12> { [ bracketright, braceright, leftsinglequotemark, rightsinglequotemark ] };
key <BKSL> { [ backslash, bar, guillemotleft, guillemotright ] };
// ASDF row
key <AC01> { [ a, A, dead_macron, U0304 ] };
key <AC02> { [ s, S, ssharp, U0311 ] };
key <AC03> { [ d, D, eth, ETH ] };
key <AC04> { [ f, F, function, U0330 ] };
key <AC05> { [ g, G, copyright, U2038 ] };
key <AC06> { [ h, H, dead_macronbelow, U0331 ] };
key <AC07> { [ j, J, dead_doubleacute, U030B ] };
key <AC08> { [ k, K, dead_abovering, U030A ] };
key <AC09> { [ l, L, dead_stroke, U0335 ] };
key <AC10> { [ semicolon, colon, ellipsis, U2116 ] };
key <AC11> { [ apostrophe, quotedbl, ae, AE ] };
// ZXCV row
key <AB01> { [ z, Z, dead_hook, U0309 ] };
key <AB02> { [ x, X, dead_belowdot, U0323 ] };
key <AB03> { [ c, C, dead_cedilla, U0327 ] };
key <AB04> { [ v, V, dead_caron, U030C ] };
key <AB05> { [ b, B, dead_breve, U0306 ] };
key <AB06> { [ n, N, dead_tilde, U0303 ] };
key <AB07> { [ m, M, dead_ogonek, U0328 ] };
key <AB08> { [ comma, less, lessthanequal, U201E ] };
key <AB09> { [ period, greater, greaterthanequal, U0294 ] };
key <AB10> { [ slash, question, division, questiondown ] };
include "level3(ralt_switch)"
};