Convert Encoder callbacks to be boolean functions (#12805)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
This commit is contained in:
@@ -131,7 +131,7 @@ bool TOG_STATUS = false;
|
||||
int RGB_current_mode;
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) { /* First encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLU);
|
||||
@@ -145,6 +145,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
tap_code(KC_DOWN);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -164,7 +164,7 @@ bool TOG_STATUS = false;
|
||||
int RGB_current_mode;
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) { /* First encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLU);
|
||||
@@ -178,6 +178,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
tap_code(KC_VOLD);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -223,9 +223,9 @@ const uint16_t PROGMEM encoders[][NUMBER_OF_ENCODERS * 2][2] = {
|
||||
)
|
||||
};
|
||||
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
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) {
|
||||
@@ -244,6 +244,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (keycode != KC_TRANSPARENT)
|
||||
tap_code16(keycode);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -79,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
};
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) { /* First encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLU);
|
||||
@@ -93,5 +93,6 @@ void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
tap_code(KC_VOLD);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
@@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_BSPC, KC_DEL, KC_ENT, KC_SPC \
|
||||
|
||||
),
|
||||
|
||||
|
||||
[_QWERTY] = LAYOUT( \
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_HOME, KC_PGUP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_END, KC_PGDN, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SLSH, \
|
||||
@@ -253,7 +253,7 @@ const uint16_t PROGMEM encoders[][NUMBER_OF_ENCODERS * 2][2] = {
|
||||
)
|
||||
};
|
||||
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (!is_keyboard_master())
|
||||
return;
|
||||
|
||||
@@ -274,6 +274,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (keycode != KC_TRANSPARENT)
|
||||
tap_code16(keycode);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -358,4 +359,4 @@ void oled_task_user(void) {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user