diff options
author | Drashna Jaelre <drashna@live.com> | 2021-05-21 23:17:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 23:17:32 -0700 |
commit | a0fed0ea176d1c986e40fc4981b900509c90d66e (patch) | |
tree | ee12f5943046015ea0dce8e2a30a68bc8eb99dbe /keyboards/clueboard/2x1800/2019 | |
parent | 76c23b15abc824f867b48d8d5100dced2417d336 (diff) |
Convert Encoder callbacks to be boolean functions (#12805)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Diffstat (limited to 'keyboards/clueboard/2x1800/2019')
-rw-r--r-- | keyboards/clueboard/2x1800/2019/2019.c | 11 | ||||
-rw-r--r-- | keyboards/clueboard/2x1800/2019/2019.h | 3 |
2 files changed, 6 insertions, 8 deletions
diff --git a/keyboards/clueboard/2x1800/2019/2019.c b/keyboards/clueboard/2x1800/2019/2019.c index 29f7a4901c..40032cd669 100644 --- a/keyboards/clueboard/2x1800/2019/2019.c +++ b/keyboards/clueboard/2x1800/2019/2019.c @@ -144,13 +144,11 @@ bool led_update_kb(led_t led_state) { return res; } -__attribute__ ((weak)) -bool encoder_update_keymap(int8_t index, bool clockwise) { - return false; -} +__attribute__((weak)) bool encoder_update_keymap(uint8_t index, bool clockwise) { return true; } +__attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { return encoder_update_keymap(index, clockwise); } -void encoder_update_kb(int8_t index, bool clockwise) { - if (!encoder_update_keymap(index, clockwise)) { +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { // Encoder 1, outside left if (index == 0 && clockwise) { tap_code(KC_MS_U); // turned right @@ -179,4 +177,5 @@ void encoder_update_kb(int8_t index, bool clockwise) { tap_code(KC_MS_L); // turned left } } + return true; } diff --git a/keyboards/clueboard/2x1800/2019/2019.h b/keyboards/clueboard/2x1800/2019/2019.h index e4738a4b90..5debfacc5d 100644 --- a/keyboards/clueboard/2x1800/2019/2019.h +++ b/keyboards/clueboard/2x1800/2019/2019.h @@ -29,8 +29,7 @@ enum TWOx1800_keycodes { #define SAFE_RANGE NEW_SAFE_RANGE // Encoder update function that returns true/false -__attribute__ ((weak)) -bool encoder_update_keymap(int8_t index, bool clockwise); +bool encoder_update_keymap(uint8_t index, bool clockwise); // Encoder button combo check void check_encoder_buttons(void); |