Convert Encoder callbacks to be boolean functions (#12805)

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
This commit is contained in:
Drashna Jaelre 2021-05-21 23:17:32 -07:00 committed by GitHub
parent 4d4211c70d
commit 768c92aab6
69 changed files with 462 additions and 396 deletions

View file

@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* rotary encoder (SW3) - add more else if blocks for more granular layer control */
#ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (IS_LAYER_ON(_RGB)) {
#ifdef RGBLIGHT_ENABLE
if (clockwise) {
@ -72,6 +72,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}
#endif

View file

@ -58,14 +58,15 @@ static void render_logo(void) {
void oled_task_user(void) { render_logo(); }
#endif
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_PGDN);
} else {
tap_code(KC_PGUP);
}
}
}
return true;
}

View file

@ -96,7 +96,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return state;
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
@ -104,4 +104,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -78,7 +78,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) {
uint8_t layer = get_highest_layer(layer_state);
if (index == 0) {
if (clockwise) {
@ -87,4 +87,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code16(dynamic_keymap_get_keycode(layer, 10, 0));
}
}
return true;
}

View file

@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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 (clockwise) {
tap_code(KC_VOLU);
@ -30,6 +30,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_PGUP);
}
}
return true;
}
#endif

View file

@ -105,7 +105,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) {
if (index == 0) { /* Left encoder */
switch (get_highest_layer(layer_state)) {
case _QWERTY:
@ -146,4 +146,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_PGUP);
}
}
return true;
}

View file

@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_H
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_MS_WH_UP);
@ -25,6 +25,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_MS_WH_DOWN);
}
}
return true;
}
//

View file

@ -48,7 +48,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) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_VOLU);
@ -68,4 +68,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
rgblight_step_reverse();
}
}
return true;
}

View file

@ -107,7 +107,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
/* With an if statement we can check which encoder was turned. */
if (index == 0) { /* First encoder */
/* And with another if statement we can check the direction. */
@ -132,4 +132,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_LEFT);
}
}
return true;
}

View file

@ -45,7 +45,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) {
if (index == 0) { /* First encoder */
if (clockwise) {
rgblight_increase_hue(); //Cycle through the RGB hue
@ -65,4 +65,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
rgblight_decrease_val();
}
}
return true;
}

View file

@ -45,14 +45,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
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);
} else {
tap_code(KC_VOLD);
}
}
}
return true;
}

View file

@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
/* Encoder */
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
/* The first if reads the first encoder, not needed on this board which only features a single one */
if (index == 0) {
/* The switch case allows for different encoder mappings on different layers, "default" map gets applied for all unspecified layers */
@ -79,4 +79,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
break;
}
}
return true;
}

View file

@ -44,7 +44,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) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_PGDN);
@ -58,4 +58,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_UP);
}
}
return true;
}

View file

@ -71,10 +71,11 @@ layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLD);
} else {
tap_code(KC_VOLU);
}
return true;
}

View file

@ -65,10 +65,11 @@ 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) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return true;
}

View file

@ -42,10 +42,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return true;
}

View file

@ -37,10 +37,11 @@ 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) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return true;
}

View file

@ -48,10 +48,10 @@ 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) {
if (clockwise)
tap_code16(KC_VOLU);
else
tap_code16(KC_VOLD);
return true;
}

View file

@ -111,7 +111,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) {
if (index == 0) { /* Left side encoder */
if (clockwise) {
tap_code(KC_PGDN);
@ -125,6 +125,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_UP);
}
}
return true;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {

View file

@ -121,7 +121,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) {
if (index == 0) { /* Left side encoder */
if (clockwise) {
tap_code(KC_PGDN);
@ -135,6 +135,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_UP);
}
}
return true;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {

View file

@ -49,7 +49,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) {
if (index == 0) { /* Left Encoder */
if (clockwise) {
tap_code(KC_VOLD);
@ -63,4 +63,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_MNXT);
}
}
return true;
}

View file

@ -52,7 +52,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) {
if (index == 0) { /* Left Encoder */
if (clockwise) {
tap_code(KC_VOLU);
@ -66,4 +66,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_MPRV);
}
}
return true;
}

View file

@ -41,7 +41,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) {
if (index == _LEFT) {
if (clockwise) {
tap_code(KC_VOLU);
@ -63,4 +63,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_PGUP);
}
}
return true;
}

View file

@ -64,7 +64,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) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
@ -72,4 +72,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -47,7 +47,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) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
@ -61,4 +61,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_PGUP);
}
}
return true;
}

View file

@ -66,7 +66,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) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
@ -81,4 +81,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_PGUP);
}
}
return true;
}

View file

@ -35,7 +35,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) {
if (index == LEFT_HALF_ENC) {
if (clockwise) {
tap_code(KC_PGDN);
@ -55,4 +55,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_UP);
}
}
return true;
}

View file

@ -34,7 +34,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) {
if (index == 0) {
if (clockwise) {
tap_code(KC_PGDN);
@ -48,4 +48,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -38,7 +38,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) {
if (index == 0) {
if (clockwise) {
tap_code(KC_PGDN);
@ -52,4 +52,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -36,7 +36,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) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
@ -51,4 +51,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_UP);
}
}
return true;
}

View file

@ -69,7 +69,7 @@ void oled_task_user(void) {
#ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
/*
Rev1.1 Rev1
,-----------------------, ,-----------------------,
@ -112,5 +112,6 @@ Rev1.1 Rev1
tap_code(KC_F24);
}
}
return true;
}
#endif

View file

@ -44,7 +44,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) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_WH_D);
@ -58,6 +58,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}
#ifdef OLED_DRIVER_ENABLE

View file

@ -50,7 +50,7 @@ static void render_logo(void) {
void oled_task_user(void) { render_logo(); }
#endif
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
tap_code(KC_AUDIO_VOL_UP);
@ -64,5 +64,6 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_BRIGHTNESS_DOWN);
}
}
return true;
}
void matrix_init_user(void) { render_logo(); }

View file

@ -67,14 +67,15 @@ static void render_logo(void) {
void oled_task_user(void) { render_logo(); }
#endif
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_PGDN);
} else {
tap_code(KC_PGUP);
}
}
}
return true;
}

View file

@ -38,7 +38,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) {
if (index == 0) {
if (clockwise) {
tap_code(KC_MNXT);
@ -46,6 +46,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_MPRV);
}
}
return true;
}
#ifdef OLED_DRIVER_ENABLE //Special thanks to Sickbabies for this great OLED widget!

View file

@ -54,7 +54,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
/* Encoder */
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
/* The first if reads the first encoder, not needed on this board which only features a single one */
if (index == 0) {
/* The switch case allows for different encoder mappings on different layers, "default" map gets applied for all unspecified layers */
@ -75,4 +75,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
break;
}
}
return true;
}

View file

@ -47,7 +47,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) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
@ -55,4 +55,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -44,7 +44,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) {
if (clockwise) {
tap_code(KC_VOLD);
@ -66,6 +66,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_DOWN);
}
}
return true;
}
#endif

View file

@ -56,7 +56,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) {
if (clockwise) {
tap_code(KC_VOLU);
@ -64,5 +64,6 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}
#endif

View file

@ -47,7 +47,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) {
switch (index) {
case 0:
if (clockwise) {
@ -57,6 +57,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
break;
}
return true;
}
#endif

View file

@ -47,7 +47,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) {
if (index == 0) { // Encoder A
if (clockwise) {
backlight_increase();
@ -61,4 +61,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -42,7 +42,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) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLU);
@ -50,4 +50,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -71,7 +71,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) {
if (index == 0) { /* Master Left */
if (clockwise) {
tap_code(KC_VOLU);
@ -85,6 +85,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -113,7 +113,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
}
uint8_t selected_layer = 0;
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (layer_state_is(2)) {
if (clockwise) {
@ -131,4 +131,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
}
}
return true;
}

View file

@ -76,7 +76,7 @@ void matrix_scan_user(void) {
}
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
encoder_cw.pressed = true;
encoder_cw.time = (timer_read() | 1);
@ -86,4 +86,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
encoder_ccw.time = (timer_read() | 1);
action_exec(encoder_ccw);
}
return true;
}

View file

@ -109,10 +109,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code16(S(KC_VOLD));
} else {
tap_code16(KC_VOLU);
}
return true;
}

View file

@ -106,7 +106,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) {
switch (get_highest_layer(layer_state)) {
case _NAV ... _SYM:
if (index == 0 || index == 1) { /* Left or right encoder */
@ -122,4 +122,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
break;
}
return true;
}

View file

@ -37,10 +37,11 @@ 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) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return true;
}

View file

@ -47,7 +47,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) {
if (index == 0) {
if (clockwise) {
tap_code(KC_AUDIO_VOL_UP);
@ -55,6 +55,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_AUDIO_VOL_DOWN);
}
}
return true;
}

View file

@ -148,13 +148,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
// Encoder is mapped to volume functions by default
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return true;
}
void matrix_init_user(void) {

View file

@ -52,10 +52,11 @@ void matrix_init_user(void) {
set_scramble_LED(LED_OFF);
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
return true;
}

View file

@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
// Encoder rotate function
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
/* First encoder */
if (index == 0) {
if (clockwise) {
@ -40,7 +40,8 @@ void encoder_update_user(uint8_t index, bool clockwise) {
} else {
tap_code(KC_AUDIO_VOL_DOWN);
}
}
}
return true;
}
// Encoder click function

View file

@ -120,7 +120,7 @@ uint16_t muse_counter = 0;
uint8_t muse_offset = 70;
uint16_t muse_tempo = 50;
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (muse_mode) {
if (IS_LAYER_ON(_RAISE)) {
if (clockwise) {
@ -144,6 +144,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
unregister_code(KC_PGUP);
}
}
return true;
}
void dip_switch_update_user(uint8_t index, bool active) {

View file

@ -73,7 +73,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* Encoder on the LEFT */
if (clockwise) {
tap_code(KC_VOLU);
@ -87,4 +87,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LALT, KC_LGUI, KC_LSFT, KC_NO, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL)
};
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
switch (get_highest_layer(layer_state)) {
case _BASE:
if (clockwise) {
@ -82,6 +82,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
break;
}
return true;
}
char wpm[10];

View file

@ -70,7 +70,7 @@ void matrix_scan_user(void) {
}
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
encoder_cw.pressed = true;
encoder_cw.time = (timer_read() | 1);
@ -80,4 +80,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
encoder_ccw.time = (timer_read() | 1);
action_exec(encoder_ccw);
}
return true;
}

View file

@ -83,7 +83,7 @@ uint8_t current_frame = 0;
#define FRAME_DURATION 50
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (clockwise) {
encoder_cw.pressed = true;
encoder_cw.time = (timer_read() | 1);
@ -97,6 +97,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
anim_sleep = timer_read32();
oled_on();
}
return true;
}
static void render_pattern(void) {

View file

@ -44,7 +44,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) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_WH_U);
@ -58,4 +58,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -40,7 +40,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) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_VOLU);
@ -48,4 +48,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -35,7 +35,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) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_WH_U);
@ -49,4 +49,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLD);
}
}
return true;
}

View file

@ -37,7 +37,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){
if(index == 0) { // first encoder
if(clockwise){
tap_code(KC_AUDIO_VOL_UP);
@ -51,6 +51,7 @@ void encoder_update_user(uint8_t index, bool clockwise){
rgblight_decrease_val();
}
}
return true;
}
#ifdef OLED_DRIVER_ENABLE

View file

@ -31,7 +31,7 @@ int get_icon_start_position(int key_position) {
}
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
static const char PROGMEM UP_ICON[] = {0x1E,0};
static const char PROGMEM DOWN_ICON[] = {0x1F,0};
if (index == 0) {
@ -66,6 +66,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
}
}
return true;
}
#ifdef OLED_DRIVER_ENABLE

View file

@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
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_DOWN);
@ -67,4 +67,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_UP);
}
}
return true;
}

View file

@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
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_VOLD);
@ -71,4 +71,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLU);
}
}
return true;
}

View file

@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
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_VOLD);
@ -71,4 +71,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLU);
}
}
return true;
}

View file

@ -19,7 +19,7 @@
#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 (clockwise) {
tap_code(KC_VOLU);
@ -33,6 +33,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_PGUP);
}
}
return true;
}
#endif

View file

@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_END, KC_PGDN),
};
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if(IS_LAYER_ON(2)){
if (clockwise)
tap_code(KC_LEFT);
@ -46,6 +46,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
else
tap_code(KC_VOLD);
}
return true;
}
void matrix_init_user(void) {

View file

@ -62,7 +62,7 @@ _______, _______, _______, _______, _______,
};
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_VOLD);
@ -70,6 +70,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_VOLU);
}
}
return true;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {

View file

@ -66,7 +66,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { // Left encoder
if (clockwise) {
tap_code(KC_VOLU);
@ -81,4 +81,5 @@ void encoder_update_user(uint8_t index, bool clockwise) {
rgblight_increase_hue_noeeprom();
}
}
return true;
}