aboutsummaryrefslogtreecommitdiff
path: root/docs/ja/feature_encoders.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ja/feature_encoders.md')
-rw-r--r--docs/ja/feature_encoders.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/docs/ja/feature_encoders.md b/docs/ja/feature_encoders.md
index 7b7f394c8..21f42d38b 100644
--- a/docs/ja/feature_encoders.md
+++ b/docs/ja/feature_encoders.md
@@ -51,15 +51,18 @@ ENCODER_ENABLE = yes
51コールバック関数を `<keyboard>.c` に記述することができます: 51コールバック関数を `<keyboard>.c` に記述することができます:
52 52
53```c 53```c
54void encoder_update_kb(uint8_t index, bool clockwise) { 54bool encoder_update_kb(uint8_t index, bool clockwise) {
55 encoder_update_user(index, clockwise); 55 if (!encoder_update_user(index, clockwise)) {
56 return false;
57 }
58
56} 59}
57``` 60```
58 61
59あるいは `keymap.c` に記述することもできます: 62あるいは `keymap.c` に記述することもできます:
60 63
61```c 64```c
62void encoder_update_user(uint8_t index, bool clockwise) { 65bool encoder_update_user(uint8_t index, bool clockwise) {
63 if (index == 0) { /* First encoder */ 66 if (index == 0) { /* First encoder */
64 if (clockwise) { 67 if (clockwise) {
65 tap_code(KC_PGDN); 68 tap_code(KC_PGDN);
@@ -73,6 +76,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
73 tap_code(KC_UP); 76 tap_code(KC_UP);
74 } 77 }
75 } 78 }
79 return true;
76} 80}
77``` 81```
78 82