Blog ·
US International keyboard: the dead key problem and the fix
Why the US International layout turns quote keys into dead keys, why that breaks quotes in code, the AltGr variants, and a way to keep plain US.
US-International is the usual advice for typing accents on a US keyboard. It is built into Windows, it keeps every letter where it was, and é is two keys away. Then you type a quote, and it does not appear.
What a dead key does
On US-International, five keys become dead keys: ', ", `, ~ and ^. Press one and nothing shows. The layout waits for the next key:
- If the next key is a letter that can take the mark, you get one accented letter: ' then e is é, " then u is ü, ` then a is à, ~ then n is ñ, ^ then o is ô.
- If the next key is Space, you get the mark alone, and the space is used up.
- If the next key is anything else, you get both: ' then t is
't.
The idea is sound. These five marks look like accents, so the layout uses them as accents and needs no new keys. The trouble is that the same five keys are some of the most used keys in code, chat and Markdown.
Why programmers hate it
Quotes come before vowels all the time. In code, 'a' starts with á. In French, N'oublie comes out as Nóublie. In a regex, ^a becomes â. In Markdown, a backtick before a word that starts with a vowel, such as `echo`, puts a grave accent on the e.
The fix is a space after each of these keys: ' Space types a plain quote. Your hands learn it, and then the space that is used up starts to bite. Type say "hi" to with the normal single space after the closing quote, and you get say "hi"to, because that space went into the quote. So the rule becomes: one extra space after a quote, but two after a closing quote. Every editor and chat box on the computer now needs that rule.
There is a smaller cost too. A layout that changes the quote key changes how code and shell commands feel on every computer you use, so a borrowed laptop with plain US feels wrong in the other direction.
The AltGr variants
The fix most people want is a layout where the quote keys type quotes and the accents live somewhere else. Two systems have one built in:
- Linux. On systems that use XKB, look for English (intl., with AltGr dead keys), also identified as
us(altgr-intl). The plain keys type plain characters, and the dead keys move to AltGr, the right Alt key. Choose it in your desktop's keyboard settings, next to English (US, intl., with dead keys), which is the Windows-style one. - macOS. The normal US and ABC layouts never had this problem: their dead keys are on Option, so Option + E then e types é, and the quote key types a quote. macOS also has U.S. International – PC for people who want the Windows behavior. Typing accents on a Mac lists the Option shortcuts.
On Windows, the built-in US-International puts the dead keys on the plain quote keys. It also types some letters directly with AltGr, such as AltGr + S for ß and AltGr + N for ñ, but that does not take the dead keys away. Typing accents on Windows covers the other Windows ways.
An AltGr layout keeps the quote keys plain. Accented letters still need modifier keys or dead-key sequences, and in French, Spanish or Portuguese that is a stop every few words.
Keep the plain US layout
Typeet leaves the layout alone. You use plain US, so ', ", `, ~ and ^ type what is on them, every time. You type words without their marks, and when you finish a word with a space or punctuation, Typeet writes it with its letters:
- N'oublie pas de fermer la fenetre avant de partir. becomes N'oublie pas de fermer la fenêtre avant de partir.
- Nao te esquecas de fechar a janela antes de saires. becomes Não te esqueças de fechar a janela antes de saíres.
Typeet checks each word against word lists for your language and for English, so English words stay as they are. It also leaves alone what looks like code: camelCase, my_var, obj.dir, words with digits, iPhone, and English contractions such as don't. It is off in terminals and password managers by default, and you can turn it off for more apps in Settings › Apps.
When it changes a word you meant to keep, press Backspace right after the fix to undo it. Undo the same word ten times, and Typeet leaves that word alone. It runs on macOS, Windows and Linux, and everything happens on your computer.
Questions
How do I turn off dead keys on US International?
Switch to the plain US layout. On Linux you can also choose English (intl., with AltGr dead keys), which keeps the accents on AltGr and the quote keys plain.
How do I type a single quote on US International?
Press ', then Space. If you want a space after the quote, press Space twice.
What is the difference between US and US International?
The letters are in the same places. US-International makes ', ", `, ~ and ^ dead keys and adds letters on AltGr; plain US types those keys as they are.
Is US International good for programming?
Its dead keys can interrupt code entry because quotes, backticks and carets wait for the next key. A plain US layout with Typeet keeps those keys plain and still gives you the accents in normal text.