]> git.donarmstrong.com Git - qmk_firmware.git/blob - users/drashna/drashna.h
Update to drashna userspace (Keymap Templating) (#2338)
[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_blue        rgblight_sethsv (0xFF,  0xFF, 0xFF);
62 #define rgblight_set_red         rgblight_sethsv (0x00,  0xFF, 0xFF);
63 #define rgblight_set_green       rgblight_sethsv (0x78,  0xFF, 0xFF);
64 #define rgblight_set_orange      rgblight_sethsv (0x1E,  0xFF, 0xFF);
65 #define rgblight_set_teal        rgblight_sethsv (0xB4,  0xFF, 0xFF);
66 #define rgblight_set_magenta     rgblight_sethsv (0x12C, 0xFF, 0xFF);
67 #define rgblight_set_yellow      rgblight_sethsv (0x3C,  0xFF, 0xFF);
68 #define rgblight_set_purple      rgblight_sethsv (0x10E, 0xFF, 0xFF);
69 #define rgblight_set_white       rgblight_sethsv (0x00,  0x00, 0xFF);
70 #endif // DRASHNA_SETRGB
71
72 extern bool is_overwatch;
73 extern bool rgb_layer_change;
74
75 enum userspace_custom_keycodes {
76   EPRM = SAFE_RANGE, // can always be here
77   VRSN,
78   KC_QWERTY,
79   KC_COLEMAK,
80   KC_DVORAK,
81   KC_WORKMAN,
82   LOWER,
83   RAISE,
84   ADJUST,
85   KC_DIABLO_CLEAR,
86   KC_OVERWATCH,
87   KC_SALT,
88   KC_MORESALT,
89   KC_SALTHARD,
90   KC_GOODGAME,
91   KC_SYMM,
92   KC_JUSTGAME,
93   KC_GLHF,
94   KC_TORB,
95   KC_AIM,
96   KC_C9,
97   KC_GGEZ,
98   KC_MAKE,
99   KC_RESET,
100   KC_RGB_T,
101   KC_SECRET_1,
102   KC_SECRET_2,
103   KC_SECRET_3,
104   KC_SECRET_4,
105   KC_SECRET_5,
106   KC_FXCL,
107   NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
108 };
109
110 #ifdef TAP_DANCE_ENABLE
111 enum {
112   TD_D3_1 = 0,
113   TD_D3_2,
114   TD_D3_3,
115   TD_D3_4
116 };
117 #endif
118
119 #ifdef TAP_DANCE_ENABLE
120 #define KC_D3_1 TD(TD_D3_1)
121 #define KC_D3_2 TD(TD_D3_2)
122 #define KC_D3_3 TD(TD_D3_3)
123 #define KC_D3_4 TD(TD_D3_4)
124 #else
125 #define KC_D3_1 KC_1
126 #define KC_D3_2 KC_2
127 #define KC_D3_3 KC_3
128 #define KC_D3_4 KC_4
129 #endif
130
131 #define QMK_KEYS_PER_SCAN 8
132
133 #ifdef RGBLIGHT_ENABLE
134 #define RGBLIGHT_SLEEP
135 #endif
136
137 #define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
138
139 #ifdef FAUXCLICKY_ENABLE
140 #define AUD_ON  FC_ON
141 #define AUD_OFF FC_OFF
142 #else
143 #define AUD_ON  AU_ON
144 #define AUD_OFF AU_OFF
145 #endif 
146
147
148
149 // Since our quirky block definitions are basically a list of comma separated 
150 // arguments, we need a wrapper in order for these definitions to be 
151 // expanded before being used as arguments to the LAYOUT_xxx macro.
152 #define LAYOUT_ergodox_wrapper(...)   LAYOUT_ergodox(__VA_ARGS__)
153 #define KEYMAP_wrapper(...)           KEYMAP(__VA_ARGS__)
154
155 // Blocks for each of the four major keyboard layouts
156 // Organized so we can quickly adapt and modify all of them
157 // at once, rather than for each keyboard, one at a time.
158 // And this allows wor much cleaner blocks in the keymaps.
159 // For instance Tap/Hold for Control on all of the layouts
160
161 #define _________________QWERTY_L1_________________        KC_Q,    KC_W,    KC_E,    KC_R,    KC_T
162 #define _________________QWERTY_L2_________________        KC_A,    KC_S,    KC_D,    KC_F,    KC_G
163 #define _________________QWERTY_L3_________________  CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
164
165 #define _________________QWERTY_R1_________________        KC_Y,    KC_U,    KC_I,    KC_O,    KC_P
166 #define _________________QWERTY_R2_________________        KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN
167 #define _________________QWERTY_R3_________________        KC_N,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
168
169
170 #define _________________COLEMAK_L1________________       KC_Q,    KC_W,    KC_F,    KC_P,    KC_G
171 #define _________________COLEMAK_L2________________       KC_A,    KC_R,    KC_S,    KC_T,    KC_D
172 #define _________________COLEMAK_L3________________ CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
173
174 #define _________________COLEMAK_R1________________       KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN
175 #define _________________COLEMAK_R2________________       KC_H,    KC_N,    KC_E,    KC_I,    KC_O
176 #define _________________COLEMAK_R3________________       KC_K,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
177
178
179 #define _________________DVORAK_L1_________________        KC_QUOT, KC_COMM, KC_DOT, KC_P,     KC_Y
180 #define _________________DVORAK_L2_________________        KC_A,    KC_O,    KC_E,   KC_U,     KC_I
181 #define _________________DVORAK_L3_________________  CTL_T(KC_SCLN),KC_Q,    KC_J,   KC_K,     KC_X
182
183 #define _________________DVORAK_R1_________________        KC_F,    KC_G,    KC_C,    KC_R,    KC_L
184 #define _________________DVORAK_R2_________________        KC_D,    KC_H,    KC_T,    KC_N,    KC_S
185 #define _________________DVORAK_R3_________________        KC_B,    KC_M,    KC_W,    KC_V,    CTL_T(KC_Z)
186
187
188 #define _________________WORKMAN_L1________________       KC_QUOT, KC_COMM, KC_DOT, KC_P,     KC_Y
189 #define _________________WORKMAN_L2________________       KC_A,    KC_O,    KC_E,   KC_U,     KC_I
190 #define _________________WORKMAN_L3________________ CTL_T(KC_SCLN),KC_Q,    KC_J,   KC_K,     KC_X
191
192 #define _________________WORKMAN_R1________________       KC_F,    KC_G,    KC_C,    KC_R,    KC_L
193 #define _________________WORKMAN_R2________________       KC_D,    KC_H,    KC_T,    KC_N,    KC_S
194 #define _________________WORKMAN_R3________________       KC_B,    KC_M,    KC_W,    KC_V,    CTL_T(KC_Z)
195
196
197
198 // Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN),
199 // this allows us to quickly modify the bottom row for all of the layouts
200 // so we don't have to alter it 4 times and hope that we haven't missed
201 // anything
202 #define ___________ERGODOX_BOTTOM_LEFT_____________       KC_QUOT, KC_LGUI, KC_LBRC, KC_RBRC
203 #define ___________ERGODOX_BOTTOM_RIGHT____________       KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT
204 #endif