1
0
Fork 0

Fix keyboards/keymaps for boolean encoder callback changes (#12985)

This commit is contained in:
Drashna Jaelre 2021-05-27 21:30:47 -07:00 committed by GitHub
parent 5386c4c7b2
commit b963049305
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 231 additions and 228 deletions

View file

@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#ifdef ENCODER_ENABLE #ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
if (index != 0) if (index != 0)
return; return false;
tap_code(clockwise ? KC_VOLU : KC_VOLD); tap_code(clockwise ? KC_VOLU : KC_VOLD);
return true; return true;

View file

@ -107,6 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
void encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
tap_code(clockwise ? KC_VOLU : KC_VOLD); tap_code(clockwise ? KC_VOLU : KC_VOLD);
return true;
} }

View file

@ -58,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#ifdef ENCODER_ENABLE // Encoder Functionality #ifdef ENCODER_ENABLE // Encoder Functionality
uint8_t selected_layer = 0; uint8_t selected_layer = 0;
void encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
#ifdef OLED_DRIVER_ENABLE #ifdef OLED_DRIVER_ENABLE
oled_clear(); oled_clear();
oled_render(); oled_render();
@ -81,6 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
} }
} }
} }
return true;
} }
#endif #endif

View file

@ -74,7 +74,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
#ifdef ENCODER_ENABLE #ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
switch (index) { switch (index) {
case 0: case 0:
if (clockwise) { if (clockwise) {
@ -84,7 +84,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
} }
break; break;
} }
return true;
} }
#endif #endif

View file

@ -72,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
}; };
#ifdef ENCODER_ENABLE #ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
switch (index) { switch (index) {
case 0: case 0:
if (clockwise) { if (clockwise) {
@ -82,7 +82,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
} }
break; break;
} }
return true;
} }
#endif #endif

View file

@ -35,7 +35,7 @@ enum tap_dances{
}; };
void encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder*/ if (index == 0) { /* First encoder*/
switch(biton32(layer_state)){ switch(biton32(layer_state)){
case _MAIN: case _MAIN:
@ -75,6 +75,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
break; break;
} }
} }
return true;
} }
// //
@ -121,6 +122,3 @@ qk_tap_dance_action_t tap_dance_actions[] = {
[TD_TO_MAIN] = ACTION_TAP_DANCE_LAYER_MOVE(KC_MUTE, _MAIN), [TD_TO_MAIN] = ACTION_TAP_DANCE_LAYER_MOVE(KC_MUTE, _MAIN),
[TD_RESET_SLIDER] = ACTION_TAP_DANCE_LAYER_MOVE(KC_0, _MAIN) [TD_RESET_SLIDER] = ACTION_TAP_DANCE_LAYER_MOVE(KC_0, _MAIN)
}; };

View file

@ -180,7 +180,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
bool encoder_mode = false; bool encoder_mode = false;
void encoder_update(bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */ if (index == 0) { /* First encoder */
if (clockwise) { if (clockwise) {
#ifdef MOUSEKEY_ENABLE #ifdef MOUSEKEY_ENABLE
@ -210,6 +210,7 @@ void encoder_update(bool clockwise) {
} }
} }
} }
return true;
} }
void dip_switch_update_user(uint8_t index, bool active) { void dip_switch_update_user(uint8_t index, bool active) {

View file

@ -531,7 +531,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef ENCODER_ENABLE #ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { if (index == 0) {
if (clockwise) { if (clockwise) {
tap_code(KC_VOLU); tap_code(KC_VOLU);
@ -566,6 +566,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
break; break;
} }
} }
return true;
} }
#endif #endif

View file

@ -531,7 +531,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef ENCODER_ENABLE #ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { if (index == 0) {
if (clockwise) { if (clockwise) {
tap_code(KC_VOLU); tap_code(KC_VOLU);
@ -566,6 +566,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
break; break;
} }
} }
return true;
} }
#endif #endif