diff options
Diffstat (limited to 'docs/feature_encoders.md')
-rw-r--r-- | docs/feature_encoders.md | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index 4338c85e8..a56f093a3 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md | |||
@@ -53,15 +53,15 @@ If you are using different pinouts for the encoders on each half of a split keyb | |||
53 | The callback functions can be inserted into your `<keyboard>.c`: | 53 | The callback functions can be inserted into your `<keyboard>.c`: |
54 | 54 | ||
55 | ```c | 55 | ```c |
56 | void encoder_update_kb(uint8_t index, bool clockwise) { | 56 | bool encoder_update_kb(uint8_t index, bool clockwise) { |
57 | encoder_update_user(index, clockwise); | 57 | return encoder_update_user(index, clockwise); |
58 | } | 58 | } |
59 | ``` | 59 | ``` |
60 | 60 | ||
61 | or `keymap.c`: | 61 | or `keymap.c`: |
62 | 62 | ||
63 | ```c | 63 | ```c |
64 | void encoder_update_user(uint8_t index, bool clockwise) { | 64 | bool encoder_update_user(uint8_t index, bool clockwise) { |
65 | if (index == 0) { /* First encoder */ | 65 | if (index == 0) { /* First encoder */ |
66 | if (clockwise) { | 66 | if (clockwise) { |
67 | tap_code(KC_PGDN); | 67 | tap_code(KC_PGDN); |
@@ -75,9 +75,12 @@ void encoder_update_user(uint8_t index, bool clockwise) { | |||
75 | tap_code(KC_UP); | 75 | tap_code(KC_UP); |
76 | } | 76 | } |
77 | } | 77 | } |
78 | return true; | ||
78 | } | 79 | } |
79 | ``` | 80 | ``` |
80 | 81 | ||
82 | !> If you return `true`, this will allow the keyboard level code to run, as well. Returning `false` will override the keyboard level code. Depending on how the keyboard level function is set up. | ||
83 | |||
81 | ## Hardware | 84 | ## Hardware |
82 | 85 | ||
83 | The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground. | 86 | The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground. |