#include QMK_KEYBOARD_H
enum layer_names {
L_QWERTY,
L_LOWER,
L_RAISE,
L_ADJUST,
};
enum {
TD_BRC = 0,
TD_MIN,
TD_GV_ESC,
TD_BS
};
#define TD_ESCP TD(TD_GV_ESC)
#define TD_MINS TD(TD_MIN)
#define TD_BRAC TD(TD_BRC)
#define LT2_TAB LT(L_RAISE, KC_TAB)
#define LT2_ENT LT(L_RAISE, KC_ENT)
#define LT1_BSP LT(L_LOWER, KC_BSPACE)
#define LT1_SPC LT(L_LOWER, KC_SPC)
#define LG_ZMIN LGUI(KC_EQUAL)
#define LG_ZMOT LGUI(KC_MINUS)
#define MT_SHFT MT(MOD_RSFT, KC_ENT)
#define MT_HILF S(A(KC_LEFT))
#define MT_HIRT S(A(KC_RGHT))
#define MT_UNTB S(KC_TAB)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[L_QWERTY] = LAYOUT_preonic_grid(
TD_ESCP, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, TD_MINS, \
LT2_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, TD_BRAC, \
LT1_BSP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_SHFT, \
LG_ZMOT, LG_ZMIN, KC_LCTL, KC_LALT, KC_LGUI, KC_BSPACE, LT1_SPC, LT2_ENT, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \
),
[L_LOWER] = LAYOUT_preonic_grid(
KC_ASTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPACE, \
MT_UNTB, _______, _______, _______, _______, _______, _______, KC_MINUS, KC_PLUS, KC_PAST, KC_PSLS, _______, \
_______, MT_HILF, MT_HIRT, _______, _______, _______, _______, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_ENTER, \
_______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_BSLASH, \
_______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MRWD, KC_VOLU, KC_VOLD, KC_MFFD \
),
[L_RAISE] = LAYOUT_preonic_grid(
KC_ASTG, KC_F1, KC_F2, KC_VOLU, KC_VOLD, _______, _______, KC_PSLS, KC_PAST, KC_LPRN, KC_RPRN, _______, \
_______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PLUS, _______, \
_______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_MINUS, _______, \
KC_CAPS, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PSLS, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_COMM, _______ \
),
[L_ADJUST] = LAYOUT_preonic_grid(
KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
KC_ASTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
)
};
uint32_t layer_state_set_user(uint32_t state) {
return update_tri_layer_state(state, L_LOWER, L_RAISE, L_ADJUST);
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_BRC] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_RBRC),
[TD_MIN] = ACTION_TAP_DANCE_DOUBLE(KC_MINUS, KC_EQUAL),
[TD_GV_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_GRAVE, KC_ESCAPE)
};