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