blog topics: BGP · IPv6 · more · my publications · my business: inet⁶ consult · contact: Twitter · LinkedIn · email

Bringing some unity to international keyboard layouts (posted 2021-02-05)

As most people who’ve used a keyboard in (another) European country can attest to, all the other countries use really crazy keyboard layouts. An effort like EurKEY tries to solve this by coming up with a keyboard layout that works for all latin script languages. Apple’s ABC Extended (formerly US Extended) is also a pretty good effort.

However, coming up with a really good keyboard layout is pretty easy. Getting people to abandon the keyboard layout they’re used in favor of a “better” one to is the big problem. (Insert old joke: standards are great, there are so many to choose from!) So what I wanted to do is come up with something that works for people who find themselves behind a foreign keyboard, but also those who appreciate having a layout that makes it easier to type their most-used language.

This is the idea. On a keyboard where the basic letter and number keys are not where you expect, such as the Turkish F keyboard, you just can’t type. So if the A-Z, 0-9, the comma and period are in unexpected places, you really can't have international guests for your keyboard without changing keyboard layouts.

So A-Z 0-9 , . are in their expected (US / western Europe) locations:

For all the other letters, we accept that they can be in unexpected places. But we're going to help out visitors by having all those letters in a default backup location: if the normal key doesn't give you what you expect, just use alt. So when I type on a Spanish keyboard and I need the semicolon, I'm going to discover that that key gives me ñ instead. Rather than having to scan the keyboard to find the location of ; on Spanish keyboards, I can just type alt-; and get my semicolon. And of course alt+shift+; for : because shift+; produces (unsurprisingly) Ñ on a Spanish keyboard.

So just one thing to remember: if a key doesn’t give you the letter you expect, try again with the alt key pressed. This way, it’s still possible to have different keyboard layouts for different languages, but without leaving foreigners who find themselves behind such a keyboard in the cold. So:

We can now type all the regular ASCII characters on any keyboard. Note that the alt and alt+shift combinations are always as specified here, even if that means that the characters with and without alt are the same, like on a US keyboard. This way, it's always possible to type the alt combination and get the expected result.

Keyboard layouts for different languages also use various alt key combinations to type additional characters and accents. That's a fairly big problem because those characters are usually not printed on the keys, so good luck finding out how you type a French ç with a German keyboard layout or a Polish ł on a Dutch keyboard. So part of the unified keyboard layout is having alt combinations for (almost) all characters used in (almost) all languages written with the latin script today. And use that set of alt keys with all keyboards, so these characters can be typed in the same way on all keyboards, even tough keys like - = [ ] ; ' / (without alt) are used for characters that make the most sense in the local language.

I think it makes sense to reuse Apple’s extended layout here, as this makes it possible to type any diacritic I’ve ever heard of and more. This layout allows for no fewer than 22 different diacritics using 22 dead keys.

A dead key works like this. Suppose you need an é, but there’s no é key on your keyboard. So you type dead key for the acute accent (alt-e) and after that the e key. Result: é. Need a ú instead? Alt-e and then u = ú. And so on.

The Apple extended layout also allows for another way to reach the same result: Unicode combining characters. With these, you first type your letter and then the combining character. So a and then alt+shift-e (for the combining acute accent) results in á.

The interesting thing about the combining characters is that unlike dead keys, they work on all characters and you can can combine as many as you like.

Because we had to evict a lot of alt and alt+shift characters from the non-alphanumeric keys, and because the combining characters mostly duplicate the dead key functionality, I’m getting rid of the combining characters under alt / alt+shift. However, those remain available using their own dead key.

I tried to move all the keys that need to be moved to a logical place, but this is of course debatable. æ and Æ went from alt(+shift)-' to alt(+shift)-R as that is the only place I could free up both the unshifted and shifted alt combination. I avoided having both alt and alt+shift dead keys under the same key in order to avoid confusion and to make the combining characters dead key work better.

I also thought that having dead keys for Greek characters as well as math characters was a useful EurKEY feature, so I’m adding those. And a dead key to cover business, currency and additional typographical symbols. Superscript and subscript digits 0 - 9 can go under the math dead key. (I’m not going to specify all the math and business characters at this point.) Those dead keys, as well as two “weird character” dead keys from Apple Extended all move to the bottom row (Z - M) with alt+shift.

Finally, I added the Turkish ı (latin small letter dotless I) because that one seems to be missing from Apple extended. There’s also the capital I with dot = İ, but you can simply type that using alt-w (dead key for the “dot above” diacritic) and then I, so like all other accented letters, it doesn’t get its own alt key combination. This is the result:

This leaves five alt combinations unused for now. That seems like a good number, allowing some room for future expansion, but not wasting too much real estate. Combining it all:

But really, that's just the start. The idea is to combine these new alt and alt+shift layers with existing keyboard layouts that conform to QWERTY, 0-9, comma and period, and thus have different layouts for different languages.

This means that people typing the “default” language can do so without having to relearn anything. At the same time, those who find themselves behind a foreign keyboard have a much easier time, as well as those of us who type in multiple languages.

If you want to see what the results look like, go to this page. You can select keymaps from a list and then click "unify". They will then be compared to the original. Green outline means no change, red means the unification rules were broken, and gray means there's differences, but they fall within the rules.

After quickly checking the list of keyboard layouts on the Mac, it looks like unification could work for the following layouts: Croatian, Danish, English, Estonian, Dutch, Faroese, Finnish, French (Canada), Icelandic, Italian, Maltese, Norwegian, Portugese, Romanian, Serbian, Slovenian, Spanish, Swedish.

It won't work for French (because of the AZERTY layout) or Turkish, even Turkish QWERTY. German and other languages almost get there, but they use QWERTZ, with the Z and Y keys swapped. They could still benefit from the unified alt / alt+shift layers, though.

by .

Archives: 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021