Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Change defines by enums #19793

Merged
merged 2 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/ja/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ TMK の歴史的経緯から、キーマップに保存されたアクション
// STUFF あるいは他の名前のレイヤーを持つことができます。
// レイヤー名は全て同じ長さである必要はなく、
// また名前を完全に省略して単に数字を使うことができます。
#define _BL 0
#define _FL 1
#define _CL 2
enum layer_names {
_BL,
_FL,
_CL,
};

これらはキーマップとカスタム関数を作成するときに使うことができる便利な定義です。`GRAVE_MODS` 定義は後でカスタム関数で使われ、その下の `_BL`、`_FL`、`_CL` 定義は各レイヤーを参照しやすくします。

Expand Down
8 changes: 5 additions & 3 deletions docs/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ At the top of the file you'll find this:
// Layer names don't all need to be of the same
// length, and you can also skip them entirely
// and just use numbers.
#define _BL 0
#define _FL 1
#define _CL 2
enum layer_names {
_BL,
_FL,
_CL,
};

These are some handy definitions we can use when building our keymap and our custom function. The `GRAVE_MODS` definition will be used later in our custom function, and the following `_BL`, `_FL`, and `_CL` defines make it easier to refer to each of our layers.

Expand Down
8 changes: 5 additions & 3 deletions docs/zh-cn/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ QMK键映射定义在C源文件中,其数据结构上是一个容纳了数组
// and just use numbers.
// 译:每一层为了便于识别可以起一个名字,下划线没有实际意义 - 叫STUFF之类的也行的,
// 译:层名不需要都一样长,甚至不定义这些直接用层号也是可以的
#define _BL 0
#define _FL 1
#define _CL 2
enum layer_names {
_BL,
_FL,
_CL,
};

以上是一些便于编写键映射及自定义函数时可用的预定义,`GRAVE_MODS` 后续会用在自定义函数中,之后的 `_BL`, `_FL` 及 `_CL` 便于我们在代码中引用这些层。

Expand Down