1 #include QMK_KEYBOARD_H
3 extern keymap_config_t keymap_config;
6 #define _QWERTY 0 // Base layer
11 #define KC_NUMB MO(_NUMB)
12 #define KC_NAVI MO(_NAVI)
13 #define KC_AGRV LALT_T(KC_GRAVE)
14 #define KC_GUIE LGUI_T(KC_ESC)
18 // Tap Dance Declarations
25 void alt_grave_backslash(qk_tap_dance_state_t *state, void *user_data) {
26 if (state->count == 1) {
27 if (!state->pressed) {
28 register_code(KC_GRAVE);
30 register_code(KC_LALT);
32 } else if (state->count == 2) {
33 register_code(KC_BSLASH);
37 void alt_grave_backslash_reset(qk_tap_dance_state_t *state, void *user_data) {
38 if (state->count == 1) {
39 unregister_code(KC_GRAVE);
40 unregister_code(KC_LALT);
41 } else if (state->count == 2) {
42 unregister_code(KC_BSLASH);
46 void left_brackets(qk_tap_dance_state_t *state, void *user_data) {
47 if (state->count == 1) {
48 if (!state->pressed) {
49 register_code(KC_LSFT);
52 register_code(KC_LSFT);
54 } else if (state->count == 2) {
55 register_code(KC_LBRC);
59 void left_brackets_reset(qk_tap_dance_state_t *state, void *user_data) {
60 if (state->count == 1) {
61 unregister_code(KC_LSFT);
62 unregister_code(KC_9);
63 } else if (state->count == 2) {
64 unregister_code(KC_LBRC);
68 void right_brackets(qk_tap_dance_state_t *state, void *user_data) {
69 if (state->count == 1) {
70 if (!state->pressed) {
71 register_code(KC_RSFT);
74 register_code(KC_RSFT);
76 } else if (state->count == 2) {
77 register_code(KC_RBRC);
81 void right_brackets_reset(qk_tap_dance_state_t *state, void *user_data) {
82 if (state->count == 1) {
83 unregister_code(KC_RSFT);
84 unregister_code(KC_0);
85 } else if (state->count == 2) {
86 unregister_code(KC_RBRC);
91 // Tap Dance Definitions
92 qk_tap_dance_action_t tap_dance_actions[] = {
93 // Tap once for KC_SLSH, twice for KC_BSLS
94 [TD_LALT_GRV_BSLS] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, alt_grave_backslash, alt_grave_backslash_reset),
95 [TD_LSFT_LBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, left_brackets, left_brackets_reset),
96 [TD_RSFT_RBRC] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, right_brackets, right_brackets_reset)
100 #define KC_AGRB TD(TD_LALT_GRV_BSLS)
101 #define KC_LSBK TD(TD_LSFT_LBRC)
102 #define KC_RSBK TD(TD_RSFT_RBRC)
104 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
106 [_QWERTY] = LAYOUT_kc(
107 //,----+----+----+----+----+----. ,----+----+----+----+----+----.
108 GUIE, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, DEL,
109 //|----+----+----+----+----+----| |----+----+----+----+----+----|
110 TAB, Q, W, E, R, T, Y, U, I, O, P, BSPC,
111 //|----+----+----+----+----+----| |----+----+----+----+----+----|
112 AGRB, A, S, D, F, G, H, J, K, L, SCLN,QUOT,
113 //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
114 LSBK, Z, X, C, V, B, MINS, EQL, N, M, COMM,DOT, SLSH,RSBK,
115 //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
116 NUMB,LCTL,SPC, ENT, RCTL,NAVI
117 // `----+----+----' `----+----+----'
121 //,----+----+----+----+----+----. ,----+----+----+----+----+----.
122 F12, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
123 //|----+----+----+----+----+----| |----+----+----+----+----+----|
124 NO, F17, F18, F19, F20, NO, NO, 7, 8, 9, 0, TRNS,
125 //|----+----+----+----+----+----| |----+----+----+----+----+----|
126 TRNS,F13, F14, F15, F16, NO, ASTR, 4, 5, 6, PLUS,TRNS,
127 //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
128 TRNS,F21, F22, F23, F24, NO, TRNS, TRNS,SLSH, 1, 2, 3, MINS,TRNS,
129 //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
130 TRNS,TRNS,TRNS, TRNS,DOT, TRNS
131 // `----+----+----' `----+----+----'
135 //,----+----+----+----+----+----. ,----+----+----+----+----+----.
136 PWR, MUTE,VOLD,VOLU,BRID,BRIU, REST,DBUG, NO, NO, NO, TRNS,
137 //|----+----+----+----+----+----| |----+----+----+----+----+----|
138 WAKE,HOME,PGUP, UP, PGDN,TRNS, NO, NO, NO, NO, NO, TRNS,
139 //|----+----+----+----+----+----| |----+----+----+----+----+----|
140 TRNS,END, LEFT,DOWN,RGHT,TRNS, PAUS,CAPS,PSCR,SLCK,INS, TRNS,
141 //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
142 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, NO, NO, NO, NO, NO, TRNS,
143 //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
144 TRNS,TRNS,TRNS, TRNS,TRNS,TRNS
145 // `----+----+----' `----+----+----'