#include QMK_KEYBOARD_H
enum {
DEF_LAYER,
MOD_LAYER,
};
enum {
TD_CAR,
TD_PRINT,
TD_CAM_UP,
TD_CAM_DN
};
void camera_number(uint16_t tens, uint16_t ones) {
register_code16(KC_LSFT);
tap_code(KC_8);
tap_code(KC_8);
unregister_code16(KC_LSFT);
tap_code(tens);
tap_code(ones);
tap_code(KC_ENT);
}
void cam_up(qk_tap_dance_state_t *state, void *user_data) {
switch (state->count) {
case 1:
tap_code(KC_C); break;
case 2:
camera_number(KC_2,KC_0); break;
}
}
void cam_down(qk_tap_dance_state_t *state, void *user_data) {
switch (state->count) {
case 1:
tap_code16(LSFT(KC_C)); break;
case 2:
camera_number(KC_1,KC_8); break;
}
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_CAR] = ACTION_TAP_DANCE_DOUBLE(
LSFT(KC_V), LCTL(KC_V) ),
[TD_PRINT] = ACTION_TAP_DANCE_DOUBLE(
LCTL(LALT(LSFT(KC_S))), LGUI(KC_PSCR) ),
[TD_CAM_UP] = ACTION_TAP_DANCE_FN(cam_up),
[TD_CAM_DN] = ACTION_TAP_DANCE_FN(cam_down)
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[DEF_LAYER] = LAYOUT_ortho_6x4(
TD(TD_CAM_UP), KC_V, LSFT(KC_P3), LCTL(KC_P3),
TD(TD_CAM_DN), TD(TD_CAR), LSFT(KC_P1), LCTL(KC_P1),
LSFT(KC_P4), KC_P5, LSFT(KC_P6), KC_P8,
KC_P4, KC_W, KC_P6, TD(TD_PRINT),
KC_A, KC_S, KC_D, LALT(KC_K),
KC_LCTL, KC_LALT, LCTL(KC_F12), LT(MOD_LAYER, KC_SPACE) ),
[MOD_LAYER] = LAYOUT_ortho_6x4(
KC_B, KC_PGUP, LCTL(KC_P6), KC_P7,
LSFT(KC_B), KC_PGDOWN, LCTL(KC_P4), KC_P1,
KC_RBRC, KC_EQL, _______,
_______,
KC_LBRC, KC_MINS, _______,
_______,
_______,
_______,
_______,
_______,
_______,
LALT(KC_M), RALT(KC_ENTER), _______
),
};