Skip to content

getKeyboardLayoutStore

ts
function getKeyboardLayoutStore(): Store<KeyboardLayoutMap | null>;

Defined in: keyboard-layout.ts:27

The store that holds the browser's keyboard layout once loadKeyboardLayout has loaded it. Framework adapters read it to label physical bindings, so [KeyQ] shows as A on a French AZERTY keyboard, and devtools show it. Matching and recording never read it.

The state is null until the layout loads, and stays null where the browser has no layout API: Firefox, Safari, servers, and cross-origin frames without the keyboard-map permission. Pass the state to formatForDisplay as layoutMap when you format labels yourself.

Returns

Store<KeyboardLayoutMap | null>