2 Copyright 2017 Christopher Courtney <drashna@live.com> @drashna
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.
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.
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/>.
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))
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);
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);
80 //#define rgblight_set_ rgblight_sethsv (0, 255, 255);
81 #endif // DRASHNA_SETRGB
83 extern bool is_overwatch;
84 extern bool rgb_layer_change;
86 enum userspace_custom_keycodes {
87 EPRM = SAFE_RANGE, // can always be here
118 NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
121 #ifdef TAP_DANCE_ENABLE
128 #endif // TAP_DANCE_ENABLE
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
144 #endif // TAP_DANCE_ENABLE
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
151 #define QMK_KEYS_PER_SCAN 8
153 #ifdef RGBLIGHT_ENABLE
154 #define RGBLIGHT_SLEEP
155 #endif // RGBLIGHT_ENABLE
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
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
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
172 #define AUD_OFF FC_OFF
173 #else // FAUXCLICKY_ENABLE
175 #define AUD_OFF AU_OFF
176 #endif // FAUXCLICKY_ENABLE
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__)
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
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.
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
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)
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
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)
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
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)
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
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)
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
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