Hotkey strings type-check against the keys of a US QWERTY keyboard, so {{useHotkey 'Mod+Ö' this.toggleComment}} is a type error. The hotkey itself works: it fires when a German user presses Ctrl+Ö or Command+Ö. Only the type check rejects it. Registering the layouts your app targets makes TypeScript and Glint accept their keys.
Registering a layout changes types only. It doesn't change how hotkeys match, and it adds no code to your bundle. Most apps don't need it. Use it when your app targets users of specific layouts and you want shortcuts on keys only those layouts have.
A hotkey on a key that only one layout types fires only for users of that layout. US users can't press Mod+Ö. For a shortcut every user should have, bind A to Z or 0 to 9 instead. TanStack Hotkeys matches these on other layouts, and many US punctuation keys too:
Register a layout when the key itself matters, such as a single-key ß shortcut, or a shortcut that your German interface labels with Ö.
Augment Register with keys, a union of the sets your app targets. Each set is a type exported from @tanstack/ember-hotkeys:
import type { GermanKeys, UsKeys } from '@tanstack/ember-hotkeys'
declare module '@tanstack/ember-hotkeys' {
interface Register {
keys: UsKeys | GermanKeys
}
}Put this in any file of your TypeScript project, such as app/app.ts or a .gts component. If you also register app hotkeys, add keys to the same Register interface, or declare it in another file. TypeScript merges the two.
German keys now type-check wherever a hotkey goes:
{{useHotkey 'Mod+Ö' this.toggleComment}}
{{useHotkey 'ß' this.toggleSidebar}}
{{! Still accepted, because UsKeys is listed }}
{{useHotkey 'Mod+[' this.outdent}}
{{! Type error: Spanish isn't registered }}
{{useHotkey 'Mod+Ñ' this.search}}Glint applies the registration to templates, so ember-tsc reports the Mod+Ñ error in the template above. It applies to hotkeys in your TypeScript code too.
useHotkeys, the onHotkey and onHotkeys modifiers, useHotkeyHint, useFormatForDisplay, app hotkeys, custom hotkeys, and the Hotkey and HotkeyChord types all follow the registration.
26 exported sets cover 33 layouts. Identical layouts share aliases, such as AustrianKeys and GermanKeys. Each set includes characters typed unshifted or with Shift across Windows, macOS, and Linux, excluding dead keys and AltGr or Option characters:
| Set | Layouts |
|---|---|
| UsKeys | US QWERTY (default) |
| UkKeys | UK (British) |
| GermanKeys, AustrianKeys | German and Austrian QWERTZ |
| SwissGermanKeys, SwissFrenchKeys | Swiss German and Swiss French |
| FrenchKeys, BelgianKeys | French and Belgian AZERTY |
| CanadianFrenchKeys | Canadian French |
| SpanishKeys, LatinAmericanKeys | Spanish (Spain) and Latin American |
| PortugueseKeys, BrazilianKeys | Portuguese (Portugal) and Brazilian ABNT2 |
| ItalianKeys | Italian |
| DanishKeys, NorwegianKeys | Danish and Norwegian |
| SwedishKeys, FinnishKeys | Swedish and Finnish |
| IcelandicKeys | Icelandic |
| CzechKeys, SlovakKeys, HungarianKeys | Czech, Slovak, and Hungarian QWERTZ |
| CroatianKeys, SlovenianKeys, SerbianLatinKeys | Croatian, Slovenian, and Serbian (Latin) |
| EstonianKeys, LithuanianKeys | Estonian and Lithuanian |
| TurkishKeys | Turkish Q |
| RomanianKeys | Romanian (standard) |
| GreekKeys, RussianKeys, UkrainianKeys, BulgarianKeys, HebrewKeys | Greek, Russian, Ukrainian, Bulgarian (BDS), and Hebrew |
Polish and Latvian share US QWERTY base keys without AltGr, and most Dutch users use US International, so they don't need separate sets.
The Keyboard Layouts example registers German keys and shows which hotkeys fire on a German keyboard.