aboutsummaryrefslogtreecommitdiff
path: root/keyboards/atreus/keymaps/xk/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/atreus/keymaps/xk/keymap.c')
-rw-r--r--keyboards/atreus/keymaps/xk/keymap.c311
1 files changed, 311 insertions, 0 deletions
diff --git a/keyboards/atreus/keymaps/xk/keymap.c b/keyboards/atreus/keymaps/xk/keymap.c
new file mode 100644
index 000000000..a03dee9ca
--- /dev/null
+++ b/keyboards/atreus/keymaps/xk/keymap.c
@@ -0,0 +1,311 @@
1// this is the style you want to emulate.
2// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
3
4#include QMK_KEYBOARD_H
5
6#define _COLEMAK 0
7#define _KAMELOC 1
8#define _IKAPILA 2
9#define _IKASHFT 3
10#define _FNCTION 5
11#define _NINEKEY 6
12#define _GAMEQWERTY 7
13#define _MLAYER 8
14#define _GRVTABL 9
15
16enum custom_keycodes {
17 COLEMAK = SAFE_RANGE,
18 KAMELOC,
19 IKAPILA,
20 IKASHFT,
21 FNCTION,
22 NINEKEY,
23 GAMEQWERTY,
24 MLAYER,
25 GRVTABL,
26};
27
28//TD Declarations
29enum {
30VOM = 0,
31PRN,
32EGT,
33HRD,
34XRD,
35DSH,
36ESC,
37EQE,
38PGN,
39HND,
40COD,
41UND,
42MND,
43F11,
44F12,
45F13,
46F14,
47F15,
48F16,
49F17,
50F18,
51F19,
52F20,
53//unicode_inputctl
54LINUX,
55WIN,
56WINSH,
57OSX,
58};
59
60// action-TAP for key/mod behavior LT(layer, KC)
61#define XK_TAB LT(_KAMELOC, KC_TAB)
62#define XK_BSP LT(_KAMELOC, KC_BSPC)
63
64#define XK_SPC LT(_IKAPILA, KC_SPC)
65#define XK_ENT LT(_IKAPILA, KC_ENT)
66#define XK_PGDN LT(_IKASHFT, KC_PGDN)
67#define XK_APO LT(_IKASHFT, KC_QUOT)
68#define XK_PGUP LT(_IKASHFT, KC_PGUP)
69#define PIPBOY LT(_FNCTION, KC_BSLS)
70
71#define XK_DEL LT(_IKASHFT, KC_DEL)
72#define XK_ESC LT(_GRVTABL, KC_ESC)
73
74// mod-TAP for mod/key behavior MT(modkey, KC)
75#define ALT_IT MT(MOD_RALT, KC_SCLN)
76#define SFT_IT MT(MOD_RSFT, KC_DOT)
77#define CTL_IT MT(MOD_RCTL, KC_SLSH)
78#define SFT_ENT MT(MOD_RSFT, KC_ENT)
79
80//sticky modifiers
81#define KYCTL OSM(MOD_LCTL)
82#define KYSFT OSM(MOD_LSFT)
83#define KYALT OSM(MOD_LALT)
84#define CAKY OSM(MOD_LCTL | MOD_LALT)
85
86//shortcuts
87#define CADEL LALT(LCTL(KC_DEL))
88#define CAINS LALT(LCTL(KC_INS))
89#define TGNKRO MAGIC_TOGGLE_NKRO
90
91#define NAVCH LCTL(KC_HOME)
92#define NAVCPD LCTL(KC_PGDN)
93#define NAVCPU LCTL(KC_PGUP)
94#define NAVCE LCTL(KC_END)
95#define NAVCU LCTL(KC_UP)
96#define NAVCD LCTL(KC_DOWN)
97#define NAVCL LCTL(KC_LEFT)
98#define NAVCR LCTL(KC_RGHT)
99#define NAVGU LGUI(KC_UP)
100#define NAVGD LGUI(KC_DOWN)
101#define NAVGL LGUI(KC_LEFT)
102#define NAVGR LGUI(KC_RGHT)
103
104#define KC_NDSH LCTL(KC_PMNS)
105#define KC_MDSH LALT(LCTL(KC_PMNS))
106
107const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
108
109 /*
110 TAP
111 ┌────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┐
112 │ Q │ W │ F │ P │ B │ │ J │ L │ U │ Y │ ; │
113 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
114 │ A │ R │ S │ T │ G │ │ M │ N │ E │ I │ O │
115 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
116 │ X │ C │ D │ V │ Z ├────┐ ┌────┤ K │ H │ , │ . │ / │
117 ├────┼────┼────┼────┼────┤ │ │ ├────┼────┼────┼────┼────┤
118 │SFTn│CTLn│ALTn│ROUS│SPC │BKSP│ │TAB │ENT │PGDN│ ' │ \ │ESC │
119 └────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
120 HOLD
121 ┌────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┐
122 │ │ │ │ │ │ │ │ │ │ │ALT │
123 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
124 │ │ │ │ │ │ │ │ │ │ │ │
125 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
126 │ │ │ │ │ ├────┐ ┌────┤ │ │ │ │CTL │
127 ├────┼────┼────┼────┼────┤ │ │ ├────┼────┼────┼────┼────┤
128 │SFT │CTL │ALT │ROUS│L123│L OH│ │L OH│L123│L!@#│ │L FN│LESC│
129 └────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
130 DOUBLETAP
131 ┌────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┐
132 │ │ │ │ │ │ │ │ │ │ │ │
133 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
134 │ │ │ │ │ │ │ │ │ │ │ │
135 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
136 │ │ │ │ │ ├────┐ ┌────┤ │ │ │ │ │
137 ├────┼────┼────┼────┼────┤ │ │ ├────┼────┼────┼────┼────┤
138 │OSML│OSML│OSML│NADA│ │ │ │ │ │ │ │ │ │
139 └────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
140 */
141
142 // Colemak PB&J (Mod-DH)
143 [_COLEMAK] = LAYOUT( \
144 KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, ALT_IT, \
145 KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, \
146 KC_X, KC_C, KC_D, KC_V, KC_Z, KC_K, KC_H, KC_COMM, SFT_IT, CTL_IT, \
147 KYCTL, KYSFT, KYALT, TT(_MLAYER), XK_SPC, XK_TAB, XK_BSP, XK_ENT, XK_PGDN, XK_APO, PIPBOY, XK_ESC \
148 ),
149
150 // useful for one-handed typing
151 [_KAMELOC] = LAYOUT( \
152 KC_SCLN, KC_Y, KC_U, KC_L, KC_J, KC_B, KC_P, KC_F, KC_W, KC_Q, \
153 KC_O, KC_I, KC_E, KC_N, KC_M, KC_G, KC_T, KC_S, KC_R, KC_A, \
154 KC_SLSH, KC_DOT, KC_COMM, KC_H, KC_K, KC_Z, KC_V, KC_D, KC_C, KC_X, \
155 XK_ESC, PIPBOY, TT(_MLAYER), KC_PGDN, KC_ENT, _______, _______, XK_SPC, KC_PGUP, KYALT, KYCTL, KYSFT \
156 ),
157
158 /*
159 ┌────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┐
160 │ 1 │ 2 │ 3 │ 4 │ 5 │ │ 6 │ 7 │ 8 │ 9 │ 0 │
161 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
162 │ M │ V- │ V+ │NEXT│PLAY│ │ ← │ ↓ │ ↑ │ → │DASH│
163 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
164 │ - │ = │ ` │GUI │UNDO├────┐ ┌────┤HOME│END │HOME│INS │ \ │
165 ├────┼────┼────┼────┼────┤ │ │ ├────┼────┼────┼────┼────┤
166 │ │ │ │ │ │ │ │ │ │GUI │ │ │ │
167 └────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
168 */
169
170 [_IKAPILA] = LAYOUT( \
171 KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \
172 KC_MUTE, KC_VOLD, KC_VOLU, TD(MND), KC_MPLY, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TD(DSH), \
173 KC_MINS, KC_EQL, KC_GRV, KC_LGUI, LCTL(KC_Z), TD(HND), KC_HOME, TD(HND), KC_INS, KC_BSLS, \
174 _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, _______, _______, KYSFT \
175 ),
176
177 /*
178 ┌────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┐
179 │ ! │ @ │ # │ $ │ % │ │ ^ │ & │ * │ ( │ ) │
180 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
181 │PSCR│ ← │ ↓ │ ↑ │ → │ │NEXT│PGUP│ V+ │ V- │DASH│
182 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
183 │ _ │ + │ ~ │HOME│END ├────┐ ┌────┤ {} │ () │ <> │ [ │ ] │
184 ├────┼────┼────┼────┼────┤ │ │ ├────┼────┼────┼────┼────┤
185 │ │ │ │ │ │DEL │ │BKSP│ │ │ │ │ │
186 └────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
187 */
188
189 [_IKASHFT] = LAYOUT( \
190 KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \
191 KC_PSCR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TD(MND), KC_PGUP, KC_VOLU, TD(VOM), KC_MDSH, \
192 KC_UNDS, KC_PLUS, KC_TILD, KC_HOME, KC_END, M(1), M(0), M(5), KC_LBRC, KC_RBRC, \
193 _______, _______, _______, _______, _______, KC_BSPC, KC_DEL, _______, _______, _______, _______, _______ \
194 ),
195
196 /*
197 ┌────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┐
198 │ F1 │ F2 │ F3 │ F4 │ F5 │ │ F6 │ F7 │ F8 │ F9 │ F10│
199 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
200 │ F21│ F22│ F23│ F24│PAUS│ │ │SCLK│BOOT│ │NKRO│
201 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
202 │ │ │ │ │ ├────┐ ┌────┤ │ │ │ │CAPS│
203 ├────┼────┼────┼────┼────┤ │ │ ├────┼────┼────┼────┼────┤
204 │ │ │ │ │ │ │ │ │ │ │ │ │ │
205 └────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
206 */
207
208 [_FNCTION] = LAYOUT( \
209 TD(F11), TD(F12), TD(F13), TD(F14), TD(F15), TD(F16), TD(F17), TD(F18), TD(F19), TD(F20), \
210 KC_F21, KC_F22, KC_F23, KC_F24, XXXXXXX, XXXXXXX, KC_SLCK, XXXXXXX, XXXXXXX, TGNKRO, \
211 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_CAPS, \
212 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
213 ),
214
215 [_GAMEQWERTY] = LAYOUT( \
216 KC_P, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, \
217 KC_SCLN, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, \
218 KC_SLSH, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, TD(COD), \
219 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
220 ),
221
222 /*
223 ┌────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┐
224 │^HOM│^PGD│^UP │^PGU│^PGU│ │ │MW_L│ MU │MW_R│ AC2│
225 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
226 │^END│^LFT│^DWN│^RGT│^PGD│ │ │ ML │ MD │ MR │ AC1│
227 ├────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┤
228 │ M5 │ M2 │ M4 │ M3 │ M1 ├────┐ ┌────┤ │MW_D│MW_U│ │ AC0│
229 ├────┼────┼────┼────┼────┤ │ │ ├────┼────┼────┼────┼────┤
230 │ │ │ │ │ │ │ │ │ │ │ │ │ │
231 └────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘
232 */
233
234 [_MLAYER] = LAYOUT( \
235 LALT(KC_ESC), KC_9, KC_8, KC_7, KC_6, M(1), M(0), KC_MS_U, M(0), M(2), \
236 KC_0, KC_2, KC_3, KC_4, KC_5, M(5), KC_MS_L, KC_MS_D, KC_MS_R, KC_ACL2, \
237 KC_1, KC_0, XXXXXXX, XXXXXXX, KC_BTN5, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, M(5), \
238 _______, _______, _______, _______, KC_BTN1, KC_BTN2, KC_BTN2, KC_BTN1, KC_BTN2, _______, KC_ACL0, _______ \
239 ),
240
241 //one_ring=2__rule__them-all
242 [_GRVTABL] = LAYOUT( \
243 LALT(KC_PSCR), M(4), KC_PWR, KC_POWER, RESET, RESET, KC_R, KC_E, KC_I, LALT(KC_PSCR), \
244 TG(_NINEKEY), TG(_FNCTION), TG(_MLAYER), TG(_IKASHFT), TG(_IKAPILA), TG(_IKAPILA), KC_S, KC_U, KC_B, TG(_NINEKEY), \
245 M(3), TG(_GAMEQWERTY), XXXXXXX, XXXXXXX, XXXXXXX, KC_MYCM, KC_CALC, XXXXXXX, TG(_GAMEQWERTY), M(3), \
246 TT(_GRVTABL), TG(_FNCTION), TG(_MLAYER), TG(_IKASHFT), TG(_IKAPILA), _______, _______, TG(_IKAPILA), TG(_IKASHFT), TG(_MLAYER), TG(_MLAYER), TG(_NINEKEY) \
247 ),
248};
249
250qk_tap_dance_action_t tap_dance_actions[] = {
251 [VOM] = ACTION_TAP_DANCE_DOUBLE(KC_VOLD, KC_MUTE),
252 [PRN] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, KC_RPRN),
253 [EGT] = ACTION_TAP_DANCE_DOUBLE(KC_LCBR, KC_RCBR),
254 [HRD] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_RBRC),
255 [DSH] = ACTION_TAP_DANCE_DOUBLE(KC_NDSH, KC_MDSH),
256 [ESC] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, LALT(KC_F4)),
257 [EQE] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_ENT),
258 [UND] = ACTION_TAP_DANCE_DOUBLE(KC_Z, LCTL(KC_Z)),
259 [PGN] = ACTION_TAP_DANCE_DOUBLE(KC_PGDN, KC_PGUP),
260 [HND] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_END),
261 [COD] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT),
262 [MND] = ACTION_TAP_DANCE_DOUBLE(KC_MNXT, KC_MPRV),
263 [F11] = ACTION_TAP_DANCE_DOUBLE(KC_F1, KC_F11),
264 [F12] = ACTION_TAP_DANCE_DOUBLE(KC_F2, KC_F12),
265 [F13] = ACTION_TAP_DANCE_DOUBLE(KC_F3, KC_F13),
266 [F14] = ACTION_TAP_DANCE_DOUBLE(KC_F4, KC_F14),
267 [F15] = ACTION_TAP_DANCE_DOUBLE(KC_F5, KC_F15),
268 [F16] = ACTION_TAP_DANCE_DOUBLE(KC_F6, KC_F16),
269 [F17] = ACTION_TAP_DANCE_DOUBLE(KC_F7, KC_F17),
270 [F18] = ACTION_TAP_DANCE_DOUBLE(KC_F8, KC_F18),
271 [F19] = ACTION_TAP_DANCE_DOUBLE(KC_F9, KC_F19),
272 [F20] = ACTION_TAP_DANCE_DOUBLE(KC_F10, KC_F20),
273};
274
275void matrix_init_user(){
276 set_unicode_input_mode(UC_LNX);
277}
278
279const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
280 if (record->event.pressed) {
281 switch(id) {
282 case 0:
283 return MACRO( D(LSFT), T(9), U(LSFT), D(LSFT), T(0), U(LSFT), T(LEFT), END );
284 case 1:
285 return MACRO( D(LSFT), T(LBRC), U(LSFT), D(LSFT), T(RBRC), U(LSFT), T(LEFT), END );
286 case 2:
287 return MACRO( T(LBRC), T(RBRC), T(LEFT), END);
288 case 5:
289 return MACRO( D(LSFT), T(COMMA), U(LSFT), D(LSFT), T(DOT), U(LSFT), END );
290 case 3:
291 clear_keyboard();
292 return false;
293 break;
294 case 4:
295 return MACRO( D(LSFT), T(SCOLON), U(LSFT), D(LSFT), T(9), U(LSFT), D(LSFT), T(0), U(LSFT), D(LSFT), T(LBRACKET), U(LSFT), D(LSFT), T(9), U(LSFT), D(LSFT), T(SCOLON), U(LSFT), D(LSFT), T(0), U(LSFT), D(LSFT), T(BSLASH), U(LSFT), D(LSFT), T(SCOLON), U(LSFT), D(LSFT), T(7), U(LSFT), D(LSFT), T(RBRACKET), U(LSFT), T(SCOLON), D(LSFT), T(SCOLON), U(LSFT), END );
296 case WINSH:
297 set_unicode_input_mode(UC_WIN);
298 return false;
299 break;
300 case WIN:
301 set_unicode_input_mode(UC_WINC);
302 return false;
303 break;
304 case OSX:
305 set_unicode_input_mode(UC_OSX);
306 return false;
307 break;
308 }
309 }
310 return MACRO_NONE;
311};