By default, hotkey strings type-check against US QWERTY keys, so createHotkey('Mod+Ö', toggleComment) triggers a TypeScript error. At runtime, it already works when a German user presses Ctrl+Ö or Cmd+Ö.
Registering extra keyboard layout sets tells TypeScript to accept those characters too. It changes types only, adds zero runtime code to your bundle, and doesn't alter how keys match.
Most apps never need to register extra layouts. A to Z, 0 to 9, and common US punctuation already match across international layouts automatically:
Register layout sets only when you intentionally target keys unique to specific layouts, such as a single-key ß shortcut or shortcuts labeled with Ö in a localized UI.
Augment Register.keys with a union of the layout types your app supports:
import type { GermanKeys, UsKeys } from '@tanstack/solid-hotkeys'
declare module '@tanstack/solid-hotkeys' {
interface Register {
keys: UsKeys | GermanKeys
}
}Place this declaration anywhere in your TypeScript project, such as your app entry file. If you also declare App Hotkeys, add keys to the same Register block or a separate declare module block. TypeScript merges both.
createHotkey('Mod+Ö', toggleComment)
createHotkey('ß', toggleSidebar)
createHotkey('Mod+[', outdent) // Valid because UsKeys is in the union
createHotkey('Mod+Ñ', search) // Type error: SpanishKeys isn't registeredAll primitives (createHotkeys, createHotkeyHint, createFormatForDisplay), app hotkeys, custom hotkeys, and Hotkey and HotkeyChord types pick up the registered union automatically.
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.
See the Keyboard Layouts example to test German layout bindings interactively.