navigator.keyboard.getLayoutMap().then((keyboardLayoutMap) => {
for (const code of keyboardLayoutMap.keys()) {
console.log(`${code} keyboard code`);
}
});KeyboardLayoutMap: keys() method / notebook
KeyboardLayoutMap: keys() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.