Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yin1999 authored Oct 5, 2024
1 parent 5481996 commit 8974966
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions files/zh-cn/web/api/keyboard/getlayoutmap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ l10n:

{{APIRef("Keyboard API")}}{{SeeCompatTable}}{{securecontext_header}}

{{domxref("Keyboard")}} 接口的 **`getLayoutMap()`** 方法返回一个 {{jsxref('Promise')}},兑现一个 {{domxref('KeyboardLayoutMap')}} 实例,该实例是一个类 map 的对象,具有检索与特定物理键关联的字符串的功能。
{{domxref("Keyboard")}} 接口的 **`getLayoutMap()`** 方法返回一个 {{jsxref('Promise')}},其会兑现一个 {{domxref('KeyboardLayoutMap')}} 实例,该实例是一个类 map 的对象,具有检索与特定物理键关联的字符串的功能。

## 语法

Expand All @@ -21,7 +21,7 @@ getLayoutMap()

### 返回值

一个 {{jsxref('Promise')}},兑现一个 {{domxref('KeyboardLayoutMap')}} 实例。
一个 {{jsxref('Promise')}},其会兑现一个 {{domxref('KeyboardLayoutMap')}} 实例。

### 异常

Expand All @@ -36,7 +36,7 @@ getLayoutMap()
const keyboard = navigator.keyboard;
keyboard.getLayoutMap().then((keyboardLayoutMap) => {
const upKey = keyboardLayoutMap.get("KeyW");
window.alert(`Press ${upKey} to move up.`);
window.alert(`按下 ${upKey} 以向上移动。`);
});
```

Expand Down

0 comments on commit 8974966

Please sign in to comment.