~jojo/kyria-keymap

f8e4375f684cbfc360402004fdf49e38df2bd826 — JoJo 4 months ago b5e57e7
Replace (super +) DMEDI tap-dance w FUNC/SYMB + left encoder
1 files changed, 6 insertions(+), 19 deletions(-)

M keymap.c
M keymap.c => keymap.c +6 -19
@@ 26,19 26,9 @@ enum layers {
#define KC_SUP KC_LGUI

enum tapdance {
    DMEDI,
    DLAYO
};

void dance_media(qk_tap_dance_state_t* state, void* user_data) {
    switch (state->count) {
    case 1: tap_code(KC_MEDIA_PLAY_PAUSE); break;
    case 2: tap_code(KC_MEDIA_NEXT_TRACK); break;
    case 3: tap_code(KC_MEDIA_PREV_TRACK); break;
    default: {};
    }
}

void dance_layout(qk_tap_dance_state_t* state, void* user_data) {
    switch (state->count) {
    case 1: layer_off(QWERTY); layer_off(GAME); break;


@@ 49,7 39,6 @@ void dance_layout(qk_tap_dance_state_t* state, void* user_data) {
}

qk_tap_dance_action_t tap_dance_actions[] = {
    [DMEDI] = ACTION_TAP_DANCE_FN(dance_media),
    [DLAYO] = ACTION_TAP_DANCE_FN(dance_layout)
};



@@ 61,7 50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      KC_TAB,   KC_Q,     KC_D,     KC_R,     KC_W,     KC_B,                                                KC_J,     KC_F,     KC_U,     KC_P,     KC_SCLN,  KC_MINS,
      KC_ESC,   KC_A,     KC_S,     KC_H,     KC_T,     KC_G,                                                KC_Y,     KC_N,     KC_E,     KC_O,     KC_I,     KC_QUOT,
      KC_SUP,   KC_Z,     KC_X,     KC_M,     KC_C,     KC_V,     _______,  TD(DLAYO),   KC_DEL,   KC_BSPC,  KC_K,     KC_L,     KC_COMM,  KC_DOT,   KC_SLSH,  KC_BSLS,
                                    KC_PSCR,  C(KC_LALT),KC_LALT, KC_LCTL,  KC_ENT,      KC_SPC,   KC_LSFT,  MO(SYMB), MO(FUNC), TD(DMEDI)
                                    KC_PSCR,  C(KC_LALT),KC_LALT, KC_LCTL,  KC_ENT,      KC_SPC,   KC_LSFT,  MO(SYMB), MO(FUNC), KC_MEDIA_PLAY_PAUSE
    ),
    [QWERTY] = LAYOUT(
      _______,  KC_Q,     KC_W,     KC_E,     KC_R,     KC_T,                                                KC_Y,     KC_U,     KC_I,     KC_O,     KC_P,     KC_MINS,


@@ 97,6 86,9 @@ void encoder_update_user(uint8_t index, bool clockwise) {
#endif
    if (index == 0) {
        if (IS_LAYER_ON(FUNC)) {
            if (side_clockwise) tap_code16(KC_MEDIA_NEXT_TRACK);
            else                tap_code16(KC_MEDIA_PREV_TRACK);
        } else if (IS_LAYER_ON(SYMB)) {
            if (side_clockwise) tap_code16(LGUI(KC_MEDIA_NEXT_TRACK));
            else                tap_code16(LGUI(KC_MEDIA_PREV_TRACK));
        } else {


@@ 104,12 96,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
            else                tap_code(KC_BRIGHTNESS_DOWN);
        }
    } else {
        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);
        }
        if (side_clockwise) tap_code(KC_VOLU);
        else                tap_code(KC_VOLD);
    }
}