KeyboardLayoutMap: values() Methode

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.

Die values() Methode des KeyboardLayoutMap Interfaces gibt ein neues Iterator-Objekt zurück, das die Werte für jeden Index im KeyboardLayoutMap Objekt enthält.

Die Methode ist ansonsten identisch mit Map.prototype.values().

Syntax

js
values()

Rückgabewert

Ein neues Iterator-Objekt.

Beispiele

Das folgende Beispiel durchläuft jeden orts- oder layoutspezifischen String auf einer englischen QWERTY-Tastatur.

js
navigator.keyboard.getLayoutMap().then((keyboardLayoutMap) => {
  for (const key of keyboardLayoutMap.values()) {
    console.log(`${key} key`);
  }
});

Spezifikationen

Specification
ECMAScript® 2025 Language Specification
# sec-map.prototype.values

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
values
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

Siehe auch