1 /* Copyright 2019 Kyle Terry
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #include QMK_KEYBOARD_H
18 #define LOWER MO(_LOWER)
19 #define RAISE MO(_RAISE)
21 #define CTL_ESC CTL_T(KC_ESC)
22 #define OS_LGUI OSM (MOD_LGUI)
23 #define SGAME TO(_GAMING)
24 #define SQWER TO(_QWERTY)
36 /* tap dance for raise and lower layer switching */
38 /* tap dance for common cording */
40 /* tap dance for media keys */
46 * _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
47 * _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
48 * _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
49 * _______, _______, _______, _______, _______, _______, _______, _______
53 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
55 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LCTL, TD(TD_C),KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
56 CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LALT, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
57 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, NUM, OS_LGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
58 KC_LCTL, OS_LGUI, KC_SPC, LOWER, RAISE, KC_SPC, OS_LGUI, KC_RALT
62 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LCTL, TD(TD_C),KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
63 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_ESC, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
64 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, NUM, OS_LGUI, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
65 KC_LALT, KC_V, KC_SPC, LOWER, RAISE, KC_SPC, OS_LGUI, KC_RALT
69 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LPRN, KC_RPRN, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL,
70 _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
71 _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, _______, _______, _______, _______, TD(TD_MD), KC_MNXT,
72 _______, _______, _______, _______, _______, _______, _______, _______
76 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
77 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
78 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU,
79 _______, _______, _______, _______, _______, _______, _______, _______
83 _______, _______, KC_PGUP, _______, _______, _______, SQWER, _______, _______, _______, KC_INS, _______, KC_PSCR, _______,
84 _______, KC_HOME, KC_PGDN, KC_END, _______, _______, SGAME, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______,
85 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
86 _______, _______, _______, _______, _______, _______, _______, _______
90 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_ASTR,
91 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, KC_MINS,
92 _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DOT, KC_1, KC_2, KC_3, KC_PLUS,
93 _______, _______, _______, _______, _______, _______, _______, KC_0
97 uint32_t layer_state_set_user(uint32_t state) {
98 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
101 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
105 void matrix_init_user(void) {
109 void matrix_scan_user(void) {
113 void led_set_user(uint8_t usb_led) {
117 void td_common(qk_tap_dance_state_t *state, void *user_data) {
118 switch (state->count) {
120 /* this case handles ctrl+o which is my tmux prefix
123 reset_tap_dance(state);
126 /* this case handles shift+insert which is a common way
127 * for me to paste text in linux
129 tap_code16(S(KC_INS));
130 reset_tap_dance(state);
135 void td_media(qk_tap_dance_state_t *state, void *user_data) {
136 switch (state->count) {
139 reset_tap_dance(state);
143 reset_tap_dance(state);
148 qk_tap_dance_action_t tap_dance_actions[] = {
149 [TD_C] = ACTION_TAP_DANCE_FN(td_common),
150 [TD_MD] = ACTION_TAP_DANCE_FN(td_media),