diff options
Diffstat (limited to 'docs/ja/feature_encoders.md')
-rw-r--r-- | docs/ja/feature_encoders.md | 10 |
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 |
54 | void encoder_update_kb(uint8_t index, bool clockwise) { | 54 | bool 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 |
62 | void encoder_update_user(uint8_t index, bool clockwise) { | 65 | bool 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 | ||