]> git.donarmstrong.com Git - qmk_firmware.git/blob - users/drashna/drashna.h
Update to Drashna Keymaps and Userspace (#2650)
[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 // 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_FXCL,
87   NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
88 };
89
90 #define KC_SEC1 KC_SECRET_1
91 #define KC_SEC2 KC_SECRET_2
92 #define KC_SEC3 KC_SECRET_3
93 #define KC_SEC4 KC_SECRET_4
94 #define KC_SEC5 KC_SECRET_5
95
96 #define QWERTY KC_QWERTY
97 #define DVORAK KC_DVORAK
98 #define COLEMAK KC_COLEMAK
99 #define WORKMAN KC_WORKMAN
100 #define KC_RST KC_RESET
101
102 #ifdef TAP_DANCE_ENABLE
103 enum {
104   TD_D3_1 = 0,
105   TD_D3_2,
106   TD_D3_3,
107   TD_D3_4
108 };
109 #endif // TAP_DANCE_ENABLE
110
111
112 // Custom Keycodes for Diablo 3 layer
113 // But since TD() doesn't work when tap dance is disabled
114 // We use custom codes here, so we can substitute the right stuff
115 #ifdef TAP_DANCE_ENABLE
116 #define KC_D3_1 TD(TD_D3_1)
117 #define KC_D3_2 TD(TD_D3_2)
118 #define KC_D3_3 TD(TD_D3_3)
119 #define KC_D3_4 TD(TD_D3_4)
120 #else // TAP_DANCE_ENABLE
121 #define KC_D3_1 KC_1
122 #define KC_D3_2 KC_2
123 #define KC_D3_3 KC_3
124 #define KC_D3_4 KC_4
125 #endif // TAP_DANCE_ENABLE
126
127 // OSM keycodes, to keep things clean and easy to change
128 #define KC_MLSF OSM(MOD_LSFT)
129 #define KC_MRSF OSM(MOD_RSFT)
130
131
132
133 // If we're still using the official Faux Clicky feature, substitute codes
134 // so that we don't have any unused/blank keys.
135 #ifdef FAUXCLICKY_ENABLE
136 #define AUD_ON  FC_ON
137 #define AUD_OFF FC_OFF
138 #else // FAUXCLICKY_ENABLE
139 #define AUD_ON  AU_ON
140 #define AUD_OFF AU_OFF
141 #endif // FAUXCLICKY_ENABLE
142
143
144
145 // Since our quirky block definitions are basically a list of comma separated
146 // arguments, we need a wrapper in order for these definitions to be
147 // expanded before being used as arguments to the LAYOUT_xxx macro.
148 #if (!defined(LAYOUT) && defined(KEYMAP))
149 #define LAYOUT KEYMAP
150 #endif
151
152 #define LAYOUT_ergodox_wrapper(...)   LAYOUT_ergodox(__VA_ARGS__)
153 #define LAYOUT_ergodox_pretty_wrapper(...)   LAYOUT_ergodox_pretty(__VA_ARGS__)
154 #define KEYMAP_wrapper(...)           LAYOUT(__VA_ARGS__)
155 #define LAYOUT_wrapper(...)           LAYOUT(__VA_ARGS__)
156
157
158 // Blocks for each of the four major keyboard layouts
159 // Organized so we can quickly adapt and modify all of them
160 // at once, rather than for each keyboard, one at a time.
161 // And this allows for much cleaner blocks in the keymaps.
162 // For instance Tap/Hold for Control on all of the layouts
163
164 // NOTE: These are all the same length.  If you do a search/replace
165 //       then you need to add/remove underscores to keep the
166 //       lengths consistent.
167
168 #define _________________QWERTY_L1_________________        KC_Q,    KC_W,    KC_E,    KC_R,    KC_T
169 #define _________________QWERTY_L2_________________        KC_A,    KC_S,    KC_D,    KC_F,    KC_G
170 #define _________________QWERTY_L3_________________  CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
171
172 #define _________________QWERTY_R1_________________        KC_Y,    KC_U,    KC_I,    KC_O,    KC_P
173 #define _________________QWERTY_R2_________________        KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN
174 #define _________________QWERTY_R3_________________        KC_N,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
175
176
177 #define _________________COLEMAK_L1________________       KC_Q,    KC_W,    KC_F,    KC_P,    KC_G
178 #define _________________COLEMAK_L2________________       KC_A,    KC_R,    KC_S,    KC_T,    KC_D
179 #define _________________COLEMAK_L3________________ CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
180
181 #define _________________COLEMAK_R1________________       KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN
182 #define _________________COLEMAK_R2________________       KC_H,    KC_N,    KC_E,    KC_I,    KC_O
183 #define _________________COLEMAK_R3________________       KC_K,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
184
185 #define ______________COLEMAK_MOD_DH_L1____________       KC_Q,    KC_W,    KC_F,    KC_P,    KC_B
186 #define ______________COLEMAK_MOD_DH_L2____________       KC_A,    KC_R,    KC_S,    KC_T,    KC_G
187 #define ______________COLEMAK_MOD_DH_L3____________ CTL_T(KC_Z),   KC_X,    KC_C,    KC_D,    KC_V
188
189 #define ______________COLEMAK_MOD_DH_R1____________       KC_J,    KC_L,    KC_U,    KC_Y,    KC_SCLN
190 #define ______________COLEMAK_MOD_DH_R2____________       KC_K,    KC_N,    KC_E,    KC_I,    KC_O
191 #define ______________COLEMAK_MOD_DH_R3____________       KC_M,    KC_H,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
192
193
194 #define _________________DVORAK_L1_________________        KC_QUOT, KC_COMM, KC_DOT, KC_P,     KC_Y
195 #define _________________DVORAK_L2_________________        KC_A,    KC_O,    KC_E,   KC_U,     KC_I
196 #define _________________DVORAK_L3_________________  CTL_T(KC_SCLN),KC_Q,    KC_J,   KC_K,     KC_X
197
198 #define _________________DVORAK_R1_________________        KC_F,    KC_G,    KC_C,    KC_R,    KC_L
199 #define _________________DVORAK_R2_________________        KC_D,    KC_H,    KC_T,    KC_N,    KC_S
200 #define _________________DVORAK_R3_________________        KC_B,    KC_M,    KC_W,    KC_V,    CTL_T(KC_Z)
201
202
203 #define _________________WORKMAN_L1________________       KC_QUOT, KC_COMM, KC_DOT, KC_P,     KC_Y
204 #define _________________WORKMAN_L2________________       KC_A,    KC_O,    KC_E,   KC_U,     KC_I
205 #define _________________WORKMAN_L3________________ CTL_T(KC_SCLN),KC_Q,    KC_J,   KC_K,     KC_X
206
207 #define _________________WORKMAN_R1________________       KC_F,    KC_G,    KC_C,    KC_R,    KC_L
208 #define _________________WORKMAN_R2________________       KC_D,    KC_H,    KC_T,    KC_N,    KC_S
209 #define _________________WORKMAN_R3________________       KC_B,    KC_M,    KC_W,    KC_V,    CTL_T(KC_Z)
210
211
212 #define _________________NORMAN_L1_________________       KC_Q,    KC_W,    KC_D,    KC_F,    KC_K
213 #define _________________NORMAN_L2_________________       KC_A,    KC_S,    KC_E,    KC_T,    KC_G
214 #define _________________NORMAN_L3_________________ CTL_T(KC_Z),   KC_X,    KC_C,    KC_V,    KC_B
215
216 #define _________________NORMAN_R1_________________       KC_J,    KC_U,    KC_R,    KC_L,    KC_SCLN
217 #define _________________NORMAN_R2_________________       KC_J,    KC_N,    KC_I,    KC_O,    KC_U
218 #define _________________NORMAN_R3_________________       KC_P,    KC_M,    KC_COMM, KC_DOT,  CTL_T(KC_SLASH)
219
220
221
222 // Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN),
223 // this allows us to quickly modify the bottom row for all of the layouts
224 // so we don't have to alter it 4 times and hope that we haven't missed
225 // anything
226 #define ___________ERGODOX_BOTTOM_LEFT_____________       OSM(MOD_MEH), OSM(MOD_LGUI), KC_LBRC, KC_RBRC
227 #define ___________ERGODOX_BOTTOM_RIGHT____________       KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT
228
229
230 #endif