aboutsummaryrefslogtreecommitdiffstats
path: root/docs/ja
diff options
context:
space:
mode:
authorumi <57262844+umi-umi@users.noreply.github.com>2020-04-21 07:36:04 +0900
committerGitHub <noreply@github.com>2020-04-20 15:36:04 -0700
commitd0c3a4c8d58c1b8c60426ea2f1572fe1fe3bcd01 (patch)
treee03f323a150310504db081598164100a6c54e616 /docs/ja
parent2dca087b04c14197b70ed4295139e0c4a40562d9 (diff)
downloadfirmware-d0c3a4c8d58c1b8c60426ea2f1572fe1fe3bcd01.tar.gz
firmware-d0c3a4c8d58c1b8c60426ea2f1572fe1fe3bcd01.tar.bz2
firmware-d0c3a4c8d58c1b8c60426ea2f1572fe1fe3bcd01.zip
[Docs] Japanese translation of docs/feature_encoders.md (#8843)
* add feature_encoders.md translation * update based on comment
Diffstat (limited to 'docs/ja')
-rw-r--r--docs/ja/feature_encoders.md81
1 files changed, 81 insertions, 0 deletions
diff --git a/docs/ja/feature_encoders.md b/docs/ja/feature_encoders.md
new file mode 100644
index 000000000..0e35e7dc8
--- /dev/null
+++ b/docs/ja/feature_encoders.md
@@ -0,0 +1,81 @@
+# エンコーダ
+
+<!---
+ original document: 0.8.123:docs/feature_encoders.md
+ git diff 0.8.123 HEAD -- docs/feature_encoders.md | cat
+-->
+
+以下を `rules.mk` に追加することで基本的なエンコーダがサポートされます:
+
+```make
+ENCODER_ENABLE = yes
+```
+
+さらに、以下を `config.h` に追加します:
+
+```c
+#define ENCODERS_PAD_A { B12 }
+#define ENCODERS_PAD_B { B13 }
+```
+
+各 PAD_A/B 変数は配列を定義するため、複数のエンコーダを定義することができます。例えば:
+
+```c
+#define ENCODERS_PAD_A { encoder1a, encoder2a }
+#define ENCODERS_PAD_B { encoder1b, encoder2b }
+```
+
+エンコーダの時計回りの方向が間違っている場合は、A と B のパッド定義を交換することができます。define を使って逆にすることもできます:
+
+```c
+#define ENCODER_DIRECTION_FLIP
+```
+
+さらに、解像度を同じファイルで指定することができます (デフォルトかつお勧めは4):
+
+```c
+#define ENCODER_RESOLUTION 4
+```
+
+## 分割キーボード
+
+分割キーボードのそれぞれの側のエンコーダに異なるピン配列を使っている場合、右側のピン配列を以下のように定義することができます:
+
+```c
+#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a }
+#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b }
+```
+
+## コールバック
+
+コールバック関数を `<keyboard>.c` に記述することができます:
+
+```c
+void encoder_update_kb(uint8_t index, bool clockwise) {
+ encoder_update_user(index, clockwise);
+}
+```
+
+あるいは `keymap.c` に記述することもできます:
+
+```c
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (index == 0) { /* First encoder */
+ if (clockwise) {
+ tap_code(KC_PGDN);
+ } else {
+ tap_code(KC_PGUP);
+ }
+ } else if (index == 1) { /* Second encoder */
+ if (clockwise) {
+ tap_code(KC_DOWN);
+ } else {
+ tap_code(KC_UP);
+ }
+ }
+}
+```
+
+## ハードウェア
+
+エンコーダの A と B の線は MCU に直接配線し、C/common 線はグランドに配線する必要があります。