~jojo/kyria-keymap

b5e57e74428b6c3d945509d3ebdce66c9d324d2b — JoJo 6 months ago c92f1f7
FUNC + rotary encoders to go prev/next (radion channel)/track
1 files changed, 14 insertions(+), 2 deletions(-)

M keymap.c
M keymap.c => keymap.c +14 -2
@@ 96,8 96,20 @@ void encoder_update_user(uint8_t index, bool clockwise) {
    bool side_clockwise = index ? !clockwise : clockwise;
#endif
    if (index == 0) {
        if (side_clockwise) tap_code(KC_BRIGHTNESS_UP); else tap_code(KC_BRIGHTNESS_DOWN);
        if (IS_LAYER_ON(FUNC)) {
            if (side_clockwise) tap_code16(LGUI(KC_MEDIA_NEXT_TRACK));
            else                tap_code16(LGUI(KC_MEDIA_PREV_TRACK));
        } else {
            if (side_clockwise) tap_code(KC_BRIGHTNESS_UP);
            else                tap_code(KC_BRIGHTNESS_DOWN);
        }
    } else {
        if (side_clockwise) tap_code(KC_VOLU); else tap_code(KC_VOLD);
        if (IS_LAYER_ON(FUNC)) {
            if (side_clockwise) tap_code(KC_MEDIA_NEXT_TRACK);
            else                tap_code(KC_MEDIA_PREV_TRACK);
        } else {
            if (side_clockwise) tap_code(KC_VOLU);
            else                tap_code(KC_VOLD);
        }
    }
}