diff --git a/keyboards/clueboard/2x1800/2019/2019.c b/keyboards/clueboard/2x1800/2019/2019.c index 11111257adad..40032cd66975 100644 --- a/keyboards/clueboard/2x1800/2019/2019.c +++ b/keyboards/clueboard/2x1800/2019/2019.c @@ -144,11 +144,11 @@ bool led_update_kb(led_t led_state) { return res; } -__attribute__((weak)) bool encoder_update_keymap(int8_t index, bool clockwise) { return true; } +__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); } bool encoder_update_kb(uint8_t index, bool clockwise) { - if (encoder_update_user(index, clockwise)) { + if (!encoder_update_user(index, clockwise)) { // Encoder 1, outside left if (index == 0 && clockwise) { tap_code(KC_MS_U); // turned right @@ -177,4 +177,5 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { tap_code(KC_MS_L); // turned left } } + return true; } diff --git a/keyboards/hadron/hadron.h b/keyboards/hadron/hadron.h index 426face6f4e6..c11774729f16 100644 --- a/keyboards/hadron/hadron.h +++ b/keyboards/hadron/hadron.h @@ -1,16 +1,17 @@ #ifndef HADRON_H #define HADRON_H -#ifdef SUBPROJECT_ver0 +#include "quantum.h" + +#ifdef KEYBOARD_hadron_ver0 #include "ver0.h" #endif -#ifdef SUBPROJECT_ver2 +#ifdef KEYBOARD_hadron_ver2 #include "ver2.h" #endif -#ifdef SUBPROJECT_ver3 +#ifdef KEYBOARD_hadron_ver3 #include "ver3.h" #endif -#include "quantum.h" #define LAYOUT( \ diff --git a/keyboards/hadron/ver3/ver3.c b/keyboards/hadron/ver3/ver3.c index b780afc76ddd..0664bf4b0ec2 100644 --- a/keyboards/hadron/ver3/ver3.c +++ b/keyboards/hadron/ver3/ver3.c @@ -18,6 +18,7 @@ #include "action_layer.h" #include "haptic.h" + #ifdef RGB_MATRIX_ENABLE #include "rgb_matrix.h" @@ -181,6 +182,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return process_record_user(keycode, record); } +bool encoder_update_user(uint8_t index, bool clockwise); + bool encoder_update_kb(uint8_t index, bool clockwise) { if (!encoder_update_user(index, clockwise)) return false; encoder_value = (encoder_value + (clockwise ? 1 : -1)) % 64; diff --git a/keyboards/hadron/ver3/ver3.h b/keyboards/hadron/ver3/ver3.h index 95926469bf8e..1ad44b871f14 100644 --- a/keyboards/hadron/ver3/ver3.h +++ b/keyboards/hadron/ver3/ver3.h @@ -15,4 +15,4 @@ */ #pragma once -#include "hadron.h" \ No newline at end of file +#include "hadron.h" diff --git a/keyboards/rgbkb/sol/keymaps/default/keymap.c b/keyboards/rgbkb/sol/keymaps/default/keymap.c index bae8b30195de..0883cb775334 100644 --- a/keyboards/rgbkb/sol/keymaps/default/keymap.c +++ b/keyboards/rgbkb/sol/keymaps/default/keymap.c @@ -225,7 +225,7 @@ const uint16_t PROGMEM encoders[][NUMBER_OF_ENCODERS * 2][2] = { bool encoder_update_user(uint8_t index, bool clockwise) { if (!is_keyboard_master()) - return; + return true; #ifdef RGB_OLED_MENU if (index == RGB_OLED_MENU) { diff --git a/keyboards/splitkb/zima/zima.c b/keyboards/splitkb/zima/zima.c index d34d1a7beafb..74f9c84a7914 100644 --- a/keyboards/splitkb/zima/zima.c +++ b/keyboards/splitkb/zima/zima.c @@ -109,5 +109,6 @@ bool encoder_update_kb(uint8_t index, bool clockwise) { } else { tap_code16(KC_VOLD); } + return true; } #endif diff --git a/layouts/community/ortho_4x12/bocaj/keymap.c b/layouts/community/ortho_4x12/bocaj/keymap.c index ca7e490c0082..6adbb6d61b80 100644 --- a/layouts/community/ortho_4x12/bocaj/keymap.c +++ b/layouts/community/ortho_4x12/bocaj/keymap.c @@ -237,7 +237,7 @@ void rgb_matrix_indicators_user(void) { void matrix_init_keymap(void) {} #ifdef ENCODER_ENABLE -bool encoder_update_user(bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { switch (get_highest_layer(layer_state)) { case _RAISE: clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); diff --git a/layouts/community/ortho_4x12/buswerks/keymap.c b/layouts/community/ortho_4x12/buswerks/keymap.c index bb27e98cfe86..455db2a8a569 100644 --- a/layouts/community/ortho_4x12/buswerks/keymap.c +++ b/layouts/community/ortho_4x12/buswerks/keymap.c @@ -142,7 +142,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -bool encoder_update_user(bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { if (IS_LAYER_ON(_RAISE) || IS_LAYER_ON(_LOWER)) { if (clockwise) { register_code(KC_VOLU); diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index c4f99bd6ff22..1f3176e36851 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -348,7 +348,7 @@ void matrix_init_keymap(void) { #endif // RGB_MATRIX_INIT #ifdef ENCODER_ENABLE -bool encoder_update_user(bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { switch (get_highest_layer(layer_state)) { case _RAISE: clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); diff --git a/layouts/community/ortho_4x12/jackhumbert/keymap.c b/layouts/community/ortho_4x12/jackhumbert/keymap.c index 7491c99c3d85..08abf78d1429 100644 --- a/layouts/community/ortho_4x12/jackhumbert/keymap.c +++ b/layouts/community/ortho_4x12/jackhumbert/keymap.c @@ -130,7 +130,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); }; -bool encoder_update_user(bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { if (clockwise) { #ifdef MOUSEKEY_ENABLE tap_code(KC_MS_WH_DOWN); diff --git a/layouts/community/ortho_4x12/juno/keymap.c b/layouts/community/ortho_4x12/juno/keymap.c index 34b28170e69f..b3ef8fce536b 100644 --- a/layouts/community/ortho_4x12/juno/keymap.c +++ b/layouts/community/ortho_4x12/juno/keymap.c @@ -370,7 +370,7 @@ uint16_t muse_counter = 0; uint8_t muse_offset = 70; uint16_t muse_tempo = 50; -bool encoder_update_user(bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { if (muse_mode) { if (IS_LAYER_ON(_RAISE)) { if (clockwise) { diff --git a/layouts/community/ortho_4x12/junonum/keymap.c b/layouts/community/ortho_4x12/junonum/keymap.c index d86e85554ad7..82ff4d63a7b3 100644 --- a/layouts/community/ortho_4x12/junonum/keymap.c +++ b/layouts/community/ortho_4x12/junonum/keymap.c @@ -268,7 +268,7 @@ uint16_t muse_counter = 0; uint8_t muse_offset = 70; uint16_t muse_tempo = 50; -bool encoder_update_user(bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { if (muse_mode) { if (IS_LAYER_ON(_RAISE)) { if (clockwise) { diff --git a/layouts/community/ortho_4x12/mguterl/keymap.c b/layouts/community/ortho_4x12/mguterl/keymap.c index 1675c0c3b3dc..66039b61e6c3 100644 --- a/layouts/community/ortho_4x12/mguterl/keymap.c +++ b/layouts/community/ortho_4x12/mguterl/keymap.c @@ -257,7 +257,7 @@ uint16_t muse_counter = 0; uint8_t muse_offset = 70; uint16_t muse_tempo = 50; -bool encoder_update_user(bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { if (muse_mode) { if (IS_LAYER_ON(_RAISE)) { if (clockwise) { diff --git a/layouts/community/ortho_4x12/mindsound/keymap.c b/layouts/community/ortho_4x12/mindsound/keymap.c index 2252814ea75a..336545502f61 100644 --- a/layouts/community/ortho_4x12/mindsound/keymap.c +++ b/layouts/community/ortho_4x12/mindsound/keymap.c @@ -185,7 +185,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -bool encoder_update_user(bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { if (clockwise) { register_code(KC_VOLU); unregister_code(KC_VOLU); diff --git a/quantum/quantum.h b/quantum/quantum.h index fe6bf310aabc..e4a7c5723ceb 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -200,6 +200,10 @@ extern layer_state_t layer_state; # include "usbpd.h" #endif +#ifdef ENCODER_ENABLE +# include "encoder.h" +#endif + // For tri-layer void update_tri_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3); layer_state_t update_tri_layer_state(layer_state_t state, uint8_t layer1, uint8_t layer2, uint8_t layer3);