aboutsummaryrefslogtreecommitdiff
path: root/keyboards/keebio/dsp40/keymaps/bakingpy/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/keebio/dsp40/keymaps/bakingpy/keymap.c')
-rw-r--r--keyboards/keebio/dsp40/keymaps/bakingpy/keymap.c214
1 files changed, 214 insertions, 0 deletions
diff --git a/keyboards/keebio/dsp40/keymaps/bakingpy/keymap.c b/keyboards/keebio/dsp40/keymaps/bakingpy/keymap.c
new file mode 100644
index 000000000..7081eedbd
--- /dev/null
+++ b/keyboards/keebio/dsp40/keymaps/bakingpy/keymap.c
@@ -0,0 +1,214 @@
1/* Copyright 2021 Danny Nguyen <danny@keeb.io>
2
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7
8This program is distributed in the hope that it will be useful,
9but WITHOUT ANY WARRANTY; without even the implied warranty of
10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License
14along with this program. If not, see <http://www.gnu.org/licenses/>.
15*/
16
17#include QMK_KEYBOARD_H
18
19enum layer_names {
20 _MAC,
21 _WINDOWS,
22 _TESTMODE,
23 _LOWER,
24 _RAISE,
25 _FKEYS,
26 _ADJUST,
27};
28
29enum custom_keycodes {
30 MAC = SAFE_RANGE,
31 WINDOWS,
32 TESTMODE,
33 LOWER,
34 RAISE,
35 ADJUST,
36};
37
38#define KC_ KC_TRNS
39
40#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen
41#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen
42#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen
43#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen
44#define KC_ESCC MT(MOD_LCTL, KC_ESC)
45#define KC_LOWR LOWER
46#define KC_RASE RAISE
47#define KC_GRVF LT(_FKEYS, KC_GRV)
48#define KC_ENTS MT(MOD_LSFT, KC_ENT)
49#define KC_BL_S BL_STEP
50#define KC_BL_T BL_TOGG
51#define KC_RMOD RGB_MOD
52
53#ifndef LAYOUT_kc_ortho_4x12
54#define LAYOUT_kc_ortho_4x12( \
55 L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
56 L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
57 L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
58 L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
59 ) \
60 LAYOUT_ortho_4x12( \
61 KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \
62 KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \
63 KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \
64 KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \
65 )
66
67#endif
68
69const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
70
71 [_MAC] = LAYOUT_kc_ortho_4x12(
72 //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐
73 TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS,
74 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
75 ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT,
76 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
77 LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS,
78 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
79 GRVF,LCTL,LALT,LGUI,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT
80 //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
81 ),
82
83 [_WINDOWS] = LAYOUT_kc_ortho_4x12(
84 //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐
85 TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS,
86 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
87 ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT,
88 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
89 LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS,
90 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
91 GRVF,LALT,LGUI,LCTL,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT
92 //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
93 ),
94
95 [_TESTMODE] = LAYOUT_kc_ortho_4x12(
96 //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐
97 TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS,
98 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
99 RMOD,BL_S, S , D , F , G , RMOD,BL_S, K , L ,SCLN,QUOT,
100 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
101 LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS,
102 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
103 GRVF,LALT,LGUI,LCTL,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT
104 //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
105 ),
106
107 [_LOWER] = LAYOUT_kc_ortho_4x12(
108 //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐
109 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , ,
110 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
111 DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE,
112 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
113 ,CPYP, , ,DOWN,LCBR, RCBR, P1 , P2 , P3 ,MINS, ,
114 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
115 BL_S,BL_T, , , ,DEL , DEL , , P0 ,PDOT, ,
116 //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
117 ),
118
119 [_RAISE] = LAYOUT_kc_ortho_4x12(
120 //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐
121 ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, ,
122 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
123 DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS,
124 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
125 MUTE,MSTP,MPLY,VOLD,PGDN,MINS, PLUS,END , , , , ,
126 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
127 , , , , , , , , , , ,
128 //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
129 ),
130
131 [_FKEYS] = LAYOUT_kc_ortho_4x12(
132 //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐
133 F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,
134 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
135 , , , , , , , , , , , ,
136 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
137 , , , , , , , , , , , ,
138 //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤
139 , , , , , , , , , , ,
140 //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
141 ),
142
143/* Adjust (Lower + Raise)
144 * ,-----------------------------------------------------------------------------------.
145 * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | |
146 * |------+------+------+------+------+-------------+------+------+------+------+------|
147 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
148 * |------+------+------+------+------+------|------+------+------+------+------+------|
149 * | | | | | | | | | | | | |
150 * |------+------+------+------+------+------+------+------+------+------+------+------|
151 * | | | | | | | | | | | |
152 * `-----------------------------------------------------------------------------------'
153 */
154 [_ADJUST] = LAYOUT_ortho_4x12(
155 _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______,
156 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, MAC, WINDOWS, TESTMODE,_______, _______,
157 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
158 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
159 )
160
161
162};
163
164bool process_record_user(uint16_t keycode, keyrecord_t *record) {
165 switch (keycode) {
166 case MAC:
167 if (record->event.pressed) {
168 set_single_persistent_default_layer(_MAC);
169 }
170 return false;
171 break;
172 case WINDOWS:
173 if (record->event.pressed) {
174 set_single_persistent_default_layer(_WINDOWS);
175 }
176 return false;
177 break;
178 case TESTMODE:
179 if (record->event.pressed) {
180 set_single_persistent_default_layer(_TESTMODE);
181 }
182 return false;
183 break;
184 case LOWER:
185 if (record->event.pressed) {
186 layer_on(_LOWER);
187 update_tri_layer(_LOWER, _RAISE, _ADJUST);
188 } else {
189 layer_off(_LOWER);
190 update_tri_layer(_LOWER, _RAISE, _ADJUST);
191 }
192 return false;
193 break;
194 case RAISE:
195 if (record->event.pressed) {
196 layer_on(_RAISE);
197 update_tri_layer(_LOWER, _RAISE, _ADJUST);
198 } else {
199 layer_off(_RAISE);
200 update_tri_layer(_LOWER, _RAISE, _ADJUST);
201 }
202 return false;
203 break;
204 case ADJUST:
205 if (record->event.pressed) {
206 layer_on(_ADJUST);
207 } else {
208 layer_off(_ADJUST);
209 }
210 return false;
211 break;
212 }
213 return true;
214}