]> git.donarmstrong.com Git - qmk_firmware.git/blob - users/drashna/drashna.h
Update to drashna files (#2587)
[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 #define _QWERTY 0
24 #define _NUMLOCK 0
25 #define _COLEMAK 1
26 #define _DVORAK 2
27 #define _WORKMAN 3
28 #define _MODS 4
29 //#define _MISC 5
30 #define _NAV 6
31 #define _COVECUBE 7
32 #define _SYMB 8
33 #define _GAMEPAD 9
34 #define _DIABLO 10
35 #define _MOUS 11
36 #define _MACROS 12
37 #define _MEDIA 13
38 #define _LOWER 14
39 #define _RAISE 15
40 #define _ADJUST 16
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 #ifndef RGBLIGHT_ANIMATIONS // add "EXTRA_FLADS=-DDRASHNA_SETRGB" to enable this ... but don't
50 #define rgblight_set_blue        rgblight_setrgb (0x00,  0x00, 0xFF);
51 #define rgblight_set_red         rgblight_setrgb (0xFF,  0x00, 0x00);
52 #define rgblight_set_green       rgblight_setrgb (0x00,  0xFF, 0x00);
53 #define rgblight_set_orange      rgblight_setrgb (0xFF,  0x80, 0x00);
54 #define rgblight_set_teal        rgblight_setrgb (0x00,  0xFF, 0xFF);
55 #define rgblight_set_magenta     rgblight_setrgb (0xFF,  0x00, 0xFF);
56 #define rgblight_set_yellow      rgblight_setrgb (0xFF,  0xFF, 0x00);
57 #define rgblight_set_purple      rgblight_setrgb (0x7A,  0x00, 0xFF);
58 #define rgblight_set_white       rgblight_setrgb (0xFF,  0xFF, 0xFF);
59 #else
60 #define rgblight_set_white       rgblight_sethsv (0,  0x00, 255);
61 #define rgblight_set_red         rgblight_sethsv (0,  255, 255);
62 #define rgblight_set_coral       rgblight_sethsv (16, 176, 255);
63 #define rgblight_set_orange      rgblight_sethsv (39,  255, 255);
64 #define rgblight_set_goldenrod   rgblight_sethsv (43,  218, 218);
65 #define rgblight_set_gold        rgblight_sethsv (51,  255, 255);
66 #define rgblight_set_yellow      rgblight_sethsv (60,  255, 255);
67 #define rgblight_set_chartreuse  rgblight_sethsv (90, 255, 255);
68 #define rgblight_set_green       rgblight_sethsv (120,  255, 255);
69 #define rgblight_set_springgreen rgblight_sethsv (150,  255, 255);
70 #define rgblight_set_turquoise   rgblight_sethsv (174,  90, 112);
71 #define rgblight_set_teal        rgblight_sethsv (180,  255, 128);
72 #define rgblight_set_cyan        rgblight_sethsv (180,  255, 255);
73 #define rgblight_set_azure       rgblight_sethsv (186,  102, 255);
74 #define rgblight_set_blue        rgblight_sethsv (240,  255, 255);
75 #define rgblight_set_purple      rgblight_sethsv (270, 255, 255);
76 #define rgblight_set_magenta     rgblight_sethsv (300, 255, 255);
77 #define rgblight_set_pink        rgblight_sethsv (330, 128, 255);
78
79 //#define rgblight_set_        rgblight_sethsv (0, 255, 255);
80 #endif // DRASHNA_SETRGB
81
82 extern bool is_overwatch;
83 extern bool rgb_layer_change;
84
85 enum userspace_custom_keycodes {
86   EPRM = SAFE_RANGE, // can always be here
87   VRSN,
88   KC_QWERTY,
89   KC_COLEMAK,
90   KC_DVORAK,
91   KC_WORKMAN,
92   LOWER,
93   RAISE,
94   ADJUST,
95   KC_DIABLO_CLEAR,
96   KC_OVERWATCH,
97   KC_SALT,
98   KC_MORESALT,
99   KC_SALTHARD,
100   KC_GOODGAME,
101   KC_SYMM,
102   KC_JUSTGAME,
103   KC_GLHF,
104   KC_TORB,
105   KC_AIM,
106   KC_C9,
107   KC_GGEZ,
108   KC_MAKE,
109   KC_RESET,
110   KC_RGB_T,
111   KC_SECRET_1,
112   KC_SECRET_2,
113   KC_SECRET_3,
114   KC_SECRET_4,
115   KC_SECRET_5,
116   KC_FXCL,
117   NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
118 };
119
120 #define KC_SEC1 KC_SECRET_1
121 #define KC_SEC2 KC_SECRET_2
122 #define KC_SEC3 KC_SECRET_3
123 #define KC_SEC4 KC_SECRET_4
124 #define KC_SEC5 KC_SECRET_5
125
126 #ifdef TAP_DANCE_ENABLE
127 enum {
128   TD_D3_1 = 0,
129   TD_D3_2,
130   TD_D3_3,
131   TD_D3_4
132 };
133 #endif // TAP_DANCE_ENABLE
134
135
136 // Custom Keycodes for Diablo 3 layer
137 // But since TD() doesn't work when tap dance is disabled
138 // We use custom codes here, so we can substitute the right stuff
139 #ifdef TAP_DANCE_ENABLE
140 #define KC_D3_1 TD(TD_D3_1)
141 #define KC_D3_2 TD(TD_D3_2)
142 #define KC_D3_3 TD(TD_D3_3)
143 #define KC_D3_4 TD(TD_D3_4)
144 #else // TAP_DANCE_ENABLE
145 #define KC_D3_1 KC_1
146 #define KC_D3_2 KC_2
147 #define KC_D3_3 KC_3
148 #define KC_D3_4 KC_4
149 #endif // TAP_DANCE_ENABLE
150
151 // OSM keycodes, to keep things clean and easy to change
152 #define KC_MLSF OSM(MOD_LSFT)
153 #define KC_MRSF OSM(MOD_RSFT)
154
155
156
157 // If we're still using the official Faux Clicky feature, substitute codes
158 // so that we don't have any unused/blank keys.
159 #ifdef FAUXCLICKY_ENABLE
160 #define AUD_ON  FC_ON
161 #define AUD_OFF FC_OFF
162 #else // FAUXCLICKY_ENABLE
163 #define AUD_ON  AU_ON
164 #define AUD_OFF AU_OFF
165 #endif // FAUXCLICKY_ENABLE
166
167
168
169 // Since our quirky block definitions are basically a list of comma separated
170 // arguments, we need a wrapper in order for these definitions to be
171 // expanded before being used as arguments to the LAYOUT_xxx macro.
172 #if (!defined(LAYOUT) && defined(KEYMAP))
173 #define LAYOUT KEYMAP
174 #endif
175
176 #define LAYOUT_ergodox_wrapper(...)   LAYOUT_ergodox(__VA_ARGS__)
177 #define LAYOUT_ergodox_pretty_wrapper(...)   LAYOUT_ergodox_pretty(__VA_ARGS__)
178 #define KEYMAP_wrapper(...)           LAYOUT(__VA_ARGS__)
179
180
181 // Blocks for each of the four major keyboard layouts
182 // Organized so we can quickly adapt and modify all of them
183 // at once, rather than for each keyboard, one at a time.
184 // And this allows for much cleaner blocks in the keymaps.
185 // For instance Tap/Hold for Control on all of the layouts
186
187 // NOTE: These are all the same length.  If you do a search/replace
188 //       then you need to add/remove underscores to keep the
189 //       lengths consistent.
190
191 #define _________________QWERTY_L1_________________        KC_Q,    KC_W,    KC_E,    KC_R,    KC_T
192 #define _________________QWERTY_L2_________________        KC_A,    KC_S,    KC_D,    KC_F,    KC_G
193 #define _________________QWERTY_L3_________________  CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
194
195 #define _________________QWERTY_R1_________________        KC_Y,    KC_U,    KC_I,    KC_O,    KC_P
196 #define _________________QWERTY_R2_________________        KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN
197 #define _________________QWERTY_R3_________________        KC_N,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
198
199
200 #define _________________COLEMAK_L1________________       KC_Q,    KC_W,    KC_F,    KC_P,    KC_G
201 #define _________________COLEMAK_L2________________       KC_A,    KC_R,    KC_S,    KC_T,    KC_D
202 #define _________________COLEMAK_L3________________ CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
203
204 #define _________________COLEMAK_R1________________       KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN
205 #define _________________COLEMAK_R2________________       KC_H,    KC_N,    KC_E,    KC_I,    KC_O
206 #define _________________COLEMAK_R3________________       KC_K,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
207
208 #define ______________COLEMAK_MOD_DH_L1____________       KC_Q,    KC_W,    KC_F,    KC_P,    KC_B
209 #define ______________COLEMAK_MOD_DH_L2____________       KC_A,    KC_R,    KC_S,    KC_T,    KC_G
210 #define ______________COLEMAK_MOD_DH_L3____________ CTL_T(KC_Z),   KC_X,    KC_C,    KC_D,    KC_V
211
212 #define ______________COLEMAK_MOD_DH_R1____________       KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN
213 #define ______________COLEMAK_MOD_DH_R2____________       KC_K,    KC_N,    KC_E,    KC_I,    KC_O
214 #define ______________COLEMAK_MOD_DH_R3____________       KC_M,    KC_H,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
215
216
217 #define _________________DVORAK_L1_________________        KC_QUOT, KC_COMM, KC_DOT, KC_P,     KC_Y
218 #define _________________DVORAK_L2_________________        KC_A,    KC_O,    KC_E,   KC_U,     KC_I
219 #define _________________DVORAK_L3_________________  CTL_T(KC_SCLN),KC_Q,    KC_J,   KC_K,     KC_X
220
221 #define _________________DVORAK_R1_________________        KC_F,    KC_G,    KC_C,    KC_R,    KC_L
222 #define _________________DVORAK_R2_________________        KC_D,    KC_H,    KC_T,    KC_N,    KC_S
223 #define _________________DVORAK_R3_________________        KC_B,    KC_M,    KC_W,    KC_V,    CTL_T(KC_Z)
224
225
226 #define _________________WORKMAN_L1________________       KC_QUOT, KC_COMM, KC_DOT, KC_P,     KC_Y
227 #define _________________WORKMAN_L2________________       KC_A,    KC_O,    KC_E,   KC_U,     KC_I
228 #define _________________WORKMAN_L3________________ CTL_T(KC_SCLN),KC_Q,    KC_J,   KC_K,     KC_X
229
230 #define _________________WORKMAN_R1________________       KC_F,    KC_G,    KC_C,    KC_R,    KC_L
231 #define _________________WORKMAN_R2________________       KC_D,    KC_H,    KC_T,    KC_N,    KC_S
232 #define _________________WORKMAN_R3________________       KC_B,    KC_M,    KC_W,    KC_V,    CTL_T(KC_Z)
233
234
235 #define _________________NORMAN_L1_________________       KC_Q,    KC_W,    KC_D,    KC_F,    KC_K
236 #define _________________NORMAN_L2_________________       KC_A,    KC_S,    KC_E,    KC_T,    KC_G
237 #define _________________NORMAN_L3_________________ CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
238
239 #define _________________NORMAN_R1_________________       KC_J,    KC_U,    KC_R,    KC_L,    KC_SCLN
240 #define _________________NORMAN_R2_________________       KC_J,    KC_N,    KC_I,    KC_O,    KC_U
241 #define _________________NORMAN_R3_________________       KC_P,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
242
243
244
245 // Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN),
246 // this allows us to quickly modify the bottom row for all of the layouts
247 // so we don't have to alter it 4 times and hope that we haven't missed
248 // anything
249 #define ___________ERGODOX_BOTTOM_LEFT_____________       KC_MEH,  KC_LGUI, KC_LBRC, KC_RBRC
250 #define ___________ERGODOX_BOTTOM_RIGHT____________       KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT
251
252
253 #endif