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
values()
Rückgabewert
Ein neues Iterator-Objekt.
Beispiele
Das folgende Beispiel durchläuft jeden orts- oder layoutspezifischen String auf einer englischen QWERTY-Tastatur.
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 GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
values |
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.