]> git.donarmstrong.com Git - qmk_firmware.git/blob - users/drashna/drashna.h
Update readme.md (#2687)
[qmk_firmware.git] / users / drashna / drashna.h
1 /*
2 Copyright 2017 Christopher Courtney <drashna@live.com> @drashna
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef USERSPACE
19 #define USERSPACE
20 #include "quantum.h"
21
22 // Define layer names
23 enum userspace_layers {
24   _QWERTY = 0,
25   _NUMLOCK = 0,
26   _COLEMAK,
27   _DVORAK,
28   _WORKMAN,
29   _MODS,
30   _NAV,
31   _COVECUBE,
32   _SYMB,
33   _GAMEPAD,
34   _DIABLO,
35   _MOUS,
36   _MACROS,
37   _MEDIA,
38   _LOWER,
39   _RAISE,
40   _ADJUST,
41 };
42
43 //define modifiers
44 #define MODS_SHIFT_MASK  (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
45 #define MODS_CTRL_MASK  (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
46 #define MODS_ALT_MASK  (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
47 #define MODS_GUI_MASK  (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI))
48
49 // RGB color codes are no longer located here anymore.  Instead, you will want to
50 // head to https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h
51
52 extern bool is_overwatch;
53 extern bool rgb_layer_change;
54
55 enum userspace_custom_keycodes {
56   EPRM = SAFE_RANGE, // can always be here
57   VRSN,
58   KC_QWERTY,
59   KC_COLEMAK,
60   KC_DVORAK,
61   KC_WORKMAN,
62   LOWER,
63   RAISE,
64   ADJUST,
65   KC_DIABLO_CLEAR,
66   KC_OVERWATCH,
67   KC_SALT,
68   KC_MORESALT,
69   KC_SALTHARD,
70   KC_GOODGAME,
71   KC_SYMM,
72   KC_JUSTGAME,
73   KC_GLHF,
74   KC_TORB,
75   KC_AIM,
76   KC_C9,
77   KC_GGEZ,
78   KC_MAKE,
79   KC_RESET,
80   KC_RGB_T,
81   KC_SECRET_1,
82   KC_SECRET_2,
83   KC_SECRET_3,
84   KC_SECRET_4,
85   KC_SECRET_5,
86   KC_CCCV,
87 #ifdef UNICODE_ENABLE
88   UC_FLIP,
89 #endif //UNICODE_ENABLE
90   NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
91 };
92
93 #define KC_SEC1 KC_SECRET_1
94 #define KC_SEC2 KC_SECRET_2
95 #define KC_SEC3 KC_SECRET_3
96 #define KC_SEC4 KC_SECRET_4
97 #define KC_SEC5 KC_SECRET_5
98
99 #define QWERTY KC_QWERTY
100 #define DVORAK KC_DVORAK
101 #define COLEMAK KC_COLEMAK
102 #define WORKMAN KC_WORKMAN
103 #define KC_RST KC_RESET
104
105 #ifdef TAP_DANCE_ENABLE
106 enum {
107   TD_D3_1 = 0,
108   TD_D3_2,
109   TD_D3_3,
110   TD_D3_4
111 };
112 #endif // TAP_DANCE_ENABLE
113
114 #ifdef UNICODEMAP_ENABLE
115
116 /* use X(n) to call the  */
117
118
119 enum unicode_name {
120   THINK, // thinking face 🤔
121   GRIN, // grinning face 😊
122   SMRK, // smirk 😏
123   WEARY, // good shit 😩
124   UNAMU, // unamused 😒
125
126   SNEK, // snke 🐍
127   PENGUIN, // 🐧
128   DRAGON, // 🐉
129   MONKEY, // 🐒
130   CHICK, // 🐥
131
132   OKOK, // 👌
133   EFFU, // 🖕
134   INUP, // 👆
135   THUP, // 👍
136   THDN, // 👎
137
138   BBB, // dat B 🅱
139   POO, // poop 💩
140   HUNDR, // 100 💯
141   EGGPL, // EGGPLANT 🍆
142   WATER, // wet 💦
143   TUMBLER, // 🥃
144
145   LIT, // fire 🔥
146   IRONY, // ‽
147   DEGREE, // °
148 };
149
150
151 const uint32_t PROGMEM unicode_map[] = {
152   [THINK]     = 0x1F914,
153   [GRIN]      = 0x1F600,
154   [BBB]       = 0x1F171,
155   [POO]       = 0x1F4A9,
156   [HUNDR]     = 0x1F4AF,
157   [SMRK]      = 0x1F60F,
158   [WEARY]     = 0x1F629,
159   [EGGPL]     = 0x1F346,
160   [WATER]     = 0x1F4A6,
161   [LIT]       = 0x1F525,
162   [UNAMU]     = 0x1F612,
163   [SNEK]      = 0x1F40D,
164   [PENGUIN]   = 0x1F427,
165   [BOAR]      = 0x1F417,
166   [MONKEY]    = 0x1F412,
167   [CHICK]     = 0x1F425,
168   [DRAGON]    = 0x1F409,
169   [OKOK]      = 0x1F44C,
170   [EFFU]      = 0x1F595,
171   [INUP]      = 0x1F446,
172   [THDN]      = 0x1F44E,
173   [THUP]      = 0x1F44D,
174   [TUMBLER]   = 0x1F943,
175   [IRONY]     = 0x0203D,
176   [DEGREE]    = 0x000B0,
177  };
178
179 #endif //UNICODEMAP_ENABLE
180
181 // Custom Keycodes for Diablo 3 layer
182 // But since TD() doesn't work when tap dance is disabled
183 // We use custom codes here, so we can substitute the right stuff
184 #ifdef TAP_DANCE_ENABLE
185 #define KC_D3_1 TD(TD_D3_1)
186 #define KC_D3_2 TD(TD_D3_2)
187 #define KC_D3_3 TD(TD_D3_3)
188 #define KC_D3_4 TD(TD_D3_4)
189 #else // TAP_DANCE_ENABLE
190 #define KC_D3_1 KC_1
191 #define KC_D3_2 KC_2
192 #define KC_D3_3 KC_3
193 #define KC_D3_4 KC_4
194 #endif // TAP_DANCE_ENABLE
195
196 // OSM keycodes, to keep things clean and easy to change
197 #define KC_MLSF OSM(MOD_LSFT)
198 #define KC_MRSF OSM(MOD_RSFT)
199
200
201
202 // If we're still using the official Faux Clicky feature, substitute codes
203 // so that we don't have any unused/blank keys.
204 #ifdef FAUXCLICKY_ENABLE
205 #define AUD_ON  FC_ON
206 #define AUD_OFF FC_OFF
207 #else // FAUXCLICKY_ENABLE
208 #define AUD_ON  AU_ON
209 #define AUD_OFF AU_OFF
210 #endif // FAUXCLICKY_ENABLE
211
212
213
214 // Since our quirky block definitions are basically a list of comma separated
215 // arguments, we need a wrapper in order for these definitions to be
216 // expanded before being used as arguments to the LAYOUT_xxx macro.
217 #if (!defined(LAYOUT) && defined(KEYMAP))
218 #define LAYOUT KEYMAP
219 #endif
220
221 #define LAYOUT_ergodox_wrapper(...)   LAYOUT_ergodox(__VA_ARGS__)
222 #define LAYOUT_ergodox_pretty_wrapper(...)   LAYOUT_ergodox_pretty(__VA_ARGS__)
223 #define KEYMAP_wrapper(...)           LAYOUT(__VA_ARGS__)
224 #define LAYOUT_wrapper(...)           LAYOUT(__VA_ARGS__)
225
226
227 // Blocks for each of the four major keyboard layouts
228 // Organized so we can quickly adapt and modify all of them
229 // at once, rather than for each keyboard, one at a time.
230 // And this allows for much cleaner blocks in the keymaps.
231 // For instance Tap/Hold for Control on all of the layouts
232
233 // NOTE: These are all the same length.  If you do a search/replace
234 //       then you need to add/remove underscores to keep the
235 //       lengths consistent.
236
237 #define _________________QWERTY_L1_________________        KC_Q,    KC_W,    KC_E,    KC_R,    KC_T
238 #define _________________QWERTY_L2_________________        KC_A,    KC_S,    KC_D,    KC_F,    KC_G
239 #define _________________QWERTY_L3_________________  CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
240
241 #define _________________QWERTY_R1_________________        KC_Y,    KC_U,    KC_I,    KC_O,    KC_P
242 #define _________________QWERTY_R2_________________        KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN
243 #define _________________QWERTY_R3_________________        KC_N,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
244
245
246 #define _________________COLEMAK_L1________________       KC_Q,    KC_W,    KC_F,    KC_P,    KC_G
247 #define _________________COLEMAK_L2________________       KC_A,    KC_R,    KC_S,    KC_T,    KC_D
248 #define _________________COLEMAK_L3________________ CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
249
250 #define _________________COLEMAK_R1________________       KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN
251 #define _________________COLEMAK_R2________________       KC_H,    KC_N,    KC_E,    KC_I,    KC_O
252 #define _________________COLEMAK_R3________________       KC_K,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
253
254 #define ______________COLEMAK_MOD_DH_L1____________       KC_Q,    KC_W,    KC_F,    KC_P,    KC_B
255 #define ______________COLEMAK_MOD_DH_L2____________       KC_A,    KC_R,    KC_S,    KC_T,    KC_G
256 #define ______________COLEMAK_MOD_DH_L3____________ CTL_T(KC_Z),   KC_X,    KC_C,    KC_D,    KC_V
257
258 #define ______________COLEMAK_MOD_DH_R1____________       KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN
259 #define ______________COLEMAK_MOD_DH_R2____________       KC_K,    KC_N,    KC_E,    KC_I,    KC_O
260 #define ______________COLEMAK_MOD_DH_R3____________       KC_M,    KC_H,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
261
262
263 #define _________________DVORAK_L1_________________        KC_QUOT, KC_COMM, KC_DOT, KC_P,     KC_Y
264 #define _________________DVORAK_L2_________________        KC_A,    KC_O,    KC_E,   KC_U,     KC_I
265 #define _________________DVORAK_L3_________________  CTL_T(KC_SCLN),KC_Q,    KC_J,   KC_K,     KC_X
266
267 #define _________________DVORAK_R1_________________        KC_F,    KC_G,    KC_C,    KC_R,    KC_L
268 #define _________________DVORAK_R2_________________        KC_D,    KC_H,    KC_T,    KC_N,    KC_S
269 #define _________________DVORAK_R3_________________        KC_B,    KC_M,    KC_W,    KC_V,    CTL_T(KC_Z)
270
271
272 #define _________________WORKMAN_L1________________       KC_Q,    KC_D,    KC_R,   KC_W,     KC_B
273 #define _________________WORKMAN_L2________________       KC_A,    KC_S,    KC_H,   KC_T,     KC_G
274 #define _________________WORKMAN_L3________________ CTL_T(KC_Z),   KC_X,    KC_M,   KC_C,     KC_V
275
276 #define _________________WORKMAN_R1________________       KC_J,    KC_F,    KC_U,    KC_P,    KC_SCLN
277 #define _________________WORKMAN_R2________________       KC_Y,    KC_N,    KC_E,    KC_O,    KC_I
278 #define _________________WORKMAN_R3________________       KC_K,    KC_L,    KC_COMM, KC_DOT,    CTL_T(KC_SLASH)
279
280
281 #define _________________NORMAN_L1_________________       KC_Q,    KC_W,    KC_D,    KC_F,    KC_K
282 #define _________________NORMAN_L2_________________       KC_A,    KC_S,    KC_E,    KC_T,    KC_G
283 #define _________________NORMAN_L3_________________ CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
284
285 #define _________________NORMAN_R1_________________       KC_J,    KC_U,    KC_R,    KC_L,    KC_SCLN
286 #define _________________NORMAN_R2_________________       KC_J,    KC_N,    KC_I,    KC_O,    KC_U
287 #define _________________NORMAN_R3_________________       KC_P,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
288
289
290
291 // Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN),
292 // this allows us to quickly modify the bottom row for all of the layouts
293 // so we don't have to alter it 4 times and hope that we haven't missed
294 // anything
295 #define ___________ERGODOX_BOTTOM_LEFT_____________       OSM(MOD_MEH), OSM(MOD_LGUI), KC_LBRC, KC_RBRC
296 #define ___________ERGODOX_BOTTOM_RIGHT____________       KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT
297
298
299 #define __________________ERGODOX_THUMB_CLUSTER_____________________       ALT_T(KC_APP), KC_LGUI,                 KC_RGUI, CTL_T(KC_ESCAPE), \
300                                                                                               KC_HOME,                 KC_PGUP, \
301                                                                             KC_SPACE,KC_BSPC, KC_END,                  KC_PGDN, KC_DEL,  KC_ENTER
302
303
304 #endif