aboutsummaryrefslogtreecommitdiff
path: root/keyboards/lets_split/keymaps/mtdjr/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/lets_split/keymaps/mtdjr/keymap.c')
-rw-r--r--keyboards/lets_split/keymaps/mtdjr/keymap.c263
1 files changed, 75 insertions, 188 deletions
diff --git a/keyboards/lets_split/keymaps/mtdjr/keymap.c b/keyboards/lets_split/keymaps/mtdjr/keymap.c
index 4846772ed..72476c700 100644
--- a/keyboards/lets_split/keymaps/mtdjr/keymap.c
+++ b/keyboards/lets_split/keymaps/mtdjr/keymap.c
@@ -1,194 +1,81 @@
1#include "lets_split.h" 1#include QMK_KEYBOARD_H
2#include "action_layer.h" 2#include "mtdjr.h"
3#include "eeconfig.h"
4#include "action_macro.h"
5 3
6extern keymap_config_t keymap_config; 4extern keymap_config_t keymap_config;
7 5
8// Each layer gets a name for readability, which is then used in the keymap matrix below.
9// The underscores don't mean anything - you can have a layer called STUFF or any other name.
10// Layer names don't all need to be of the same length, obviously, and you can also skip them
11// entirely and just use numbers.
12#define _QWERTY 0
13#define _LOWER 1
14#define _RAISE 2
15#define _ADJUST 16
16
17enum custom_keycodes {
18 QWERTY = SAFE_RANGE,
19 LOWER,
20 RAISE,
21 ADJUST,
22 TD_ESC = 0
23};
24
25// Fillers to make layering more clear
26#define _______ KC_TRNS
27#define XXXXXXX KC_NO
28
29
30// Macro Declarations
31#define UM_ROOT M(0)
32#define UM_PPLY M(1)
33#define UM_COPY M(2)
34#define UM_INSR M(3)
35#define UM_PSEF M(4)
36
37 6
38const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 7const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
39 8
40 /* Qwerty 9 /* Qwerty
41 * ,-----------------------------------------. ,-----------------------------------------. 10 * ,-----------------------------------------. ,-----------------------------------------.
42 * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | 11 * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp |
43 * |------+------+------+------+------+------| |------+------+------+------+------+------| 12 * |------+------+------+------+------+------| |------+------+------+------+------+------|
44 * |Esc/~ | A | S | D | F | G | | H | J | K | L | ; | '/" | 13 * |Esc/~ | A | S | D | F | G | | H | J | K | L | ; | '/" |
45 * |------+------+------+------+------+------| |------+------+------+------+------+------| 14 * |------+------+------+------+------+------| |------+------+------+------+------+------|
46 * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | 15 * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter |
47 * |------+------+------+------+------+------| |------+------+------+------+------+------| 16 * |------+------+------+------+------+------| |------+------+------+------+------+------|
48 * |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Up | Down |Right | 17 * |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Up | Down |Right |
49 * `-----------------------------------------' '-----------------------------------------' 18 * `-----------------------------------------' '-----------------------------------------'
50 */ 19 */
51[_QWERTY] = LAYOUT( \ 20 [_QWERTY] = LAYOUT( \
52 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ 21 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
53 TD(TD_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ 22 KC_EXC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
54 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ 23 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
55 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \ 24 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT \
56), 25 ),
57 26
58 /* Lower 27 /* Lower
59 * ,-----------------------------------------. ,-----------------------------------------. 28 * ,-----------------------------------------. ,-----------------------------------------.
60 * | ~ | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | 29 * | ~ | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp |
61 * |------+------+------+------+------+------| |------+------+------+------+------+------| 30 * |------+------+------+------+------+------| |------+------+------+------+------+------|
62 * | | | [ | ] | { | } | | | 4 | 5 | 6 | * | \ | 31 * | | | [ | ] | { | } | | | 4 | 5 | 6 | * | \ |
63 * |------+------+------+------+------+------| |------+------+------+------+------+------| 32 * |------+------+------+------+------+------| |------+------+------+------+------+------|
64 * |Shift | | | copy |insert| | | | 1 | 2 | 3 | + | - | 33 * |Shift | | | copy |insert| | | | 1 | 2 | 3 | + | - |
65 * |------+------+------+------+------+------| |------+------+------+------+------+------| 34 * |------+------+------+------+------+------| |------+------+------+------+------+------|
66 * |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | 0 | . | = | _ | 35 * |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | 0 | . | = | _ |
67 * `-----------------------------------------' '-----------------------------------------' 36 * `-----------------------------------------' '-----------------------------------------'
68 */ 37 */
69[_LOWER] = LAYOUT( \ 38 [_LOWER] = LAYOUT( \
70 KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ 39 KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \
71 XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, XXXXXXX, KC_4, KC_5, KC_6, KC_ASTR, KC_BSLS, \ 40 XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, XXXXXXX, KC_4, KC_5, KC_6, KC_ASTR, KC_BSLS, \
72 _______, XXXXXXX, XXXXXXX, UM_COPY, UM_INSR, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_PLUS, KC_MINS, \ 41 _______, XXXXXXX, XXXXXXX, KC_XCPY, KC_XINS, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_PLUS, KC_MINS, \
73 _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_UNDS \ 42 _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_UNDS \
74), 43 ),
75 44
76 45
77/* Raise 46 /* Raise
78 * ,-----------------------------------------. ,-----------------------------------------. 47 * ,-----------------------------------------. ,-----------------------------------------.
79 * | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp | 48 * | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp |
80 * |------+------+------+------+------+------| |------+------+------+------+------+------| 49 * |------+------+------+------+------+------| |------+------+------+------+------+------|
81 * | | | | | | | | | | | | \ | | | 50 * | | | | | | | | | | | | \ | | |
82 * |------+------+------+------+------+------| |------+------+------+------+------+------| 51 * |------+------+------+------+------+------| |------+------+------+------+------+------|
83 * |Shift | | | | | | | | | | | | | 52 * |Shift | | | | | | | | | | | | |
84 * |------+------+------+------+------+------| |------+------+------+------+------+------| 53 * |------+------+------+------+------+------| |------+------+------+------+------+------|
85 * |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Next | Vol- | Vol+ | Play | 54 * |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Next | Vol- | Vol+ | Play |
86 * `-----------------------------------------' '-----------------------------------------' 55 * `-----------------------------------------' '-----------------------------------------'
87 */ 56 */
88[_RAISE] = LAYOUT( \ 57 [_RAISE] = LAYOUT( \
89 KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ 58 KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \
90 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_PIPE,\ 59 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_PIPE,\
91 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 60 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
92 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ 61 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
93), 62 ),
94 63
95 /* Adjust (Lower + Raise) 64 /* Adjust (Lower + Raise)
96 * ,-----------------------------------------. ,-----------------------------------------. 65 * ,-----------------------------------------. ,-----------------------------------------.
97 * | | Reset| | | | | | ROOT | PPLY | PSEF | | | Del | 66 * | | Reset| | | | | | ROOT | PPLY | PSEF | | | Del |
98 * |------+------+------+------+------+------| |------+------+------+------+------+------| 67 * |------+------+------+------+------+------| |------+------+------+------+------+------|
99 * | | | |Aud on|Audoff| | | F1 | F2 | F3 | F4 | F5 | F6 | 68 * | | | |Aud on|Audoff| | | F1 | F2 | F3 | F4 | F5 | F6 |
100 * |------+------+------+------+------+------| |------+------+------+------+------+------| 69 * |------+------+------+------+------+------| |------+------+------+------+------+------|
101 * | | UNDO | CUT | COPY |PASTE | | | F7 | F8 | F9 | F10 | F11 | F12 | 70 * | | UNDO | CUT | COPY |PASTE | | | F7 | F8 | F9 | F10 | F11 | F12 |
102 * |------+------+------+------+------+------| |------+------+------+------+------+------| 71 * |------+------+------+------+------+------| |------+------+------+------+------+------|
103 * | | | | | | | | | | Home | | | End | 72 * | | | | | | | | | | Home | | | End |
104 * `-----------------------------------------' '-----------------------------------------' 73 * `-----------------------------------------' '-----------------------------------------'
105 */ 74 */
106[_ADJUST] = LAYOUT( \ 75 [_ADJUST] = LAYOUT( \
107 _______, UM_ROOT, UM_PPLY, UM_PSEF, _______, _______, RESET, _______, _______, _______, _______, KC_DEL, \ 76 KC_STOG, KC_ROOT, KC_PPLY, KC_PSEF, _______, _______, RESET, _______, _______, _______, _______, KC_DEL, \
108 _______, _______, _______, AU_ON, AU_OFF, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, \ 77 _______, _______, _______, AU_ON, AU_OFF, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, \
109 _______, KC_UNDO, KC_CUT, UM_COPY, UM_INSR, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ 78 _______, KC_UNDO, KC_CUT, KC_XCPY, KC_XINS, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
110 _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, _______, _______, KC_END \ 79 _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, _______, _______, KC_END \
111) 80 )
112 81}; \ No newline at end of file
113
114};
115
116#ifdef AUDIO_ENABLE
117float tone_qwerty[][2] = SONG(QWERTY_SOUND);
118#endif
119
120void persistent_default_layer_set(uint16_t default_layer) {
121 eeconfig_update_default_layer(default_layer);
122 default_layer_set(default_layer);
123}
124
125qk_tap_dance_action_t tap_dance_actions[] = {
126 //Tap once for nothing, twice for ESC
127 [TD_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_NO, KC_ESC)
128};
129
130bool process_record_user(uint16_t keycode, keyrecord_t *record) {
131 switch (keycode) {
132 case QWERTY:
133 if (record->event.pressed) {
134 #ifdef AUDIO_ENABLE
135 PLAY_SONG(tone_qwerty);
136 #endif
137 persistent_default_layer_set(1UL<<_QWERTY);
138 }
139 return false;
140 break;
141 case LOWER:
142 if (record->event.pressed) {
143 layer_on(_LOWER);
144 update_tri_layer(_LOWER, _RAISE, _ADJUST);
145 } else {
146 layer_off(_LOWER);
147 update_tri_layer(_LOWER, _RAISE, _ADJUST);
148 }
149 return false;
150 break;
151 case RAISE:
152 if (record->event.pressed) {
153 layer_on(_RAISE);
154 update_tri_layer(_LOWER, _RAISE, _ADJUST);
155 } else {
156 layer_off(_RAISE);
157 update_tri_layer(_LOWER, _RAISE, _ADJUST);
158 }
159 return false;
160 break;
161 case ADJUST:
162 if (record->event.pressed) {
163 layer_on(_ADJUST);
164 } else {
165 layer_off(_ADJUST);
166 }
167 return false;
168 break;
169 }
170 return true;
171};
172
173const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
174 if (record->event.pressed) {
175 switch(id) {
176 case 0:
177 SEND_STRING("sudo su -\n");
178 return false; break;
179 case 1:
180 SEND_STRING("puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp\n");
181 return false; break;
182 case 2:
183 return MACRO(D(LCTL), T(INS), U(LCTL), END);
184 break;
185 case 3:
186 return MACRO(D(LSFT), T(INS), U(LSFT), END);
187 break;
188 case 4:
189 SEND_STRING("ps -ef | grep ");
190 return false; break;
191 }
192 }
193 return MACRO_NONE;
194};