aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManassarn Manoonchai <nazzarn@gmail.com>2017-10-25 23:11:07 +0700
committerJack Humbert <jack.humb@gmail.com>2017-10-25 06:11:07 -1000
commita3f53aeaa12e6e6ce9b5087ded35f5e3af4f3190 (patch)
tree5d83282f56ab08f97509f430eb4996ce2a23e4cb
parent6c4639bfac98e327fd395898e63670c38cb7721f (diff)
downloadqmk_firmware-a3f53aeaa12e6e6ce9b5087ded35f5e3af4f3190.tar.gz
qmk_firmware-a3f53aeaa12e6e6ce9b5087ded35f5e3af4f3190.zip
Add narze keymaps for Ergodox & Planck with SuperDuper mode implementation (#1883)
* Fork default planck keymap * Esc -> CapsLock * Swap Tilde & Grave in Lower & Raise * Replace Blacklight key with Raise * Add Hyper/Esc & Shift/Enter key * Add super duper mode using S+D combo * Change superduper mode sound * Add more functionality to superduper mode * Fork default * Replace all left shift to shift/parensopen (space cadet) * Super / Underscore * Try superduper on z/slash held * Use function/macro instead, LGUI_UNDS alone not working * ✨ Add mouse layer 🐭 * 🐛 Fix superduper * :sparkles: Fix GUI_UNDS * :bug: Fix registering underscore when releasing too fast * :bug: Fix Shift/( with LT z * ✨ Add superduper for colemak * ✨ Add Qwerty on software Colemak layout & make Superduper available on multile layouts * ✨ Enable/disable superduper mode & fix layer switching * 🐛 Fix superduper not unregister mods * ✨ Update planck-like ergodox (wip) * :bug: Fix return before changing tap count & modify comments * :sparkles: Replace with planck code * 📝 Update readme * ✨ Fix SuperDuper by using intermediate layers * Remove LT from inner lower & raise for ease of use * Change TG to LG * Add options & disable audio * :wrench: Enable ignore mod tap interrupt & shorting tapping term * :memo: Update readme * Remove including quantum makefile * :memo: Update readme * Rename Makefiles
-rw-r--r--keyboards/ergodox/keymaps/narze/config.h21
-rw-r--r--keyboards/ergodox/keymaps/narze/default.png.md1
-rw-r--r--keyboards/ergodox/keymaps/narze/default_highres.png.md1
-rw-r--r--keyboards/ergodox/keymaps/narze/keymap.c852
-rw-r--r--keyboards/ergodox/keymaps/narze/readme.md45
-rw-r--r--keyboards/ergodox/keymaps/narze/rules.mk24
-rw-r--r--keyboards/ergodox/keymaps/narze/visualizer.c94
-rw-r--r--keyboards/planck/keymaps/narze/config.h42
-rw-r--r--keyboards/planck/keymaps/narze/keymap.c524
-rw-r--r--keyboards/planck/keymaps/narze/readme.md31
-rw-r--r--keyboards/planck/keymaps/narze/rules.mk23
11 files changed, 1658 insertions, 0 deletions
diff --git a/keyboards/ergodox/keymaps/narze/config.h b/keyboards/ergodox/keymaps/narze/config.h
new file mode 100644
index 000000000..8174edd35
--- /dev/null
+++ b/keyboards/ergodox/keymaps/narze/config.h
@@ -0,0 +1,21 @@
1#ifndef CONFIG_H_
2#define CONFIG_H_
3
4#include "../../config.h"
5
6#undef TAPPING_TERM
7#define TAPPING_TERM 150
8
9// Combos not working yet
10// #define COMBO_TERM 20
11// #define COMBO_COUNT 1
12// #define COMBO_ALLOW_ACTION_KEYS
13
14#define IGNORE_MOD_TAP_INTERRUPT
15#define PERMISSIVE_HOLD
16#define PREVENT_STUCK_MODIFIERS
17
18#undef MOUSEKEY_DELAY
19#define MOUSEKEY_DELAY 100
20
21#endif
diff --git a/keyboards/ergodox/keymaps/narze/default.png.md b/keyboards/ergodox/keymaps/narze/default.png.md
new file mode 100644
index 000000000..744e7d172
--- /dev/null
+++ b/keyboards/ergodox/keymaps/narze/default.png.md
@@ -0,0 +1 @@
https://i.imgur.com/fKX0Zbs.png
diff --git a/keyboards/ergodox/keymaps/narze/default_highres.png.md b/keyboards/ergodox/keymaps/narze/default_highres.png.md
new file mode 100644
index 000000000..074e0634d
--- /dev/null
+++ b/keyboards/ergodox/keymaps/narze/default_highres.png.md
@@ -0,0 +1 @@
https://i.imgur.com/giAc3M9.jpg
diff --git a/keyboards/ergodox/keymaps/narze/keymap.c b/keyboards/ergodox/keymaps/narze/keymap.c
new file mode 100644
index 000000000..5871c221a
--- /dev/null
+++ b/keyboards/ergodox/keymaps/narze/keymap.c
@@ -0,0 +1,852 @@
1#include "ergodox.h"
2// #include "debug.h"
3#include "action_layer.h"
4#include "version.h"
5#include "eeconfig.h"
6#include "eeprom.h"
7#include "keymap_colemak.h"
8
9extern keymap_config_t keymap_config;
10
11enum ergodox_layers {
12 _QWERTY,
13 _COLEMAK,
14 _QWOC,
15 _LOWER,
16 _RAISE,
17 _PLOVER,
18// Intermediate layers for SuperDuper (Combo keys does not work on Infinity yet)
19 _SUPER,
20 _DUPER,
21 _SUPERDUPER,
22 _MOUSE,
23 _ADJUST,
24 _MDIA,
25 _SYMB,
26};
27
28enum ergodox_keycodes {
29 QWERTY = SAFE_RANGE,
30 COLEMAK,
31 QWOC,
32 PLOVER,
33 SUPER,
34 DUPER,
35 SUPERDUPER,
36 MOUSE,
37 LOWER,
38 RAISE,
39 BACKLIT,
40 EXT_PLV,
41 SDTOGG, // Toggle SuperDuper
42 EPRM,
43 VRSN,
44 RGB_SLD
45};
46
47enum functions {
48 M_GUI_UNDS, // Simulate GUI_T(KC_UNDS)
49 M_SFT_PO, // SFT_T(KC_LPRN)
50 M_SFT_PC, // SFT_T(KC_RPRN)
51};
52
53// Timer for custom mod tap
54static uint16_t m_gui_unds_timer;
55static uint16_t m_sft_po_timer;
56static uint16_t m_sft_pc_timer;
57
58// Fillers to make layering more clear
59#define _______ KC_TRNS
60#define XXXXXXX KC_NO
61
62// Narze : Custom Macros
63#define HPR_ESC ALL_T(KC_ESC)
64#define SFT_ENT SFT_T(KC_ENT)
65#define SFT_PO F(M_SFT_PO)
66#define SFT_PC F(M_SFT_PC)
67#define GUI_MINS GUI_T(KC_MINS)
68#define GUI_UNDS F(M_GUI_UNDS)
69
70// Combo : SuperDuper layer from S+D (R+S in Colemak)
71// #define COMBO_COUNT 1
72// #define SUPERDUPER_COMBO_COUNT 3
73// #define EECONFIG_SUPERDUPER_INDEX (uint8_t *) 19
74
75// enum process_combo_event {
76// CB_SUPERDUPER,
77// };
78
79// const uint16_t PROGMEM superduper_combos[SUPERDUPER_COMBO_COUNT][3] = {
80// [_QWERTY] = {KC_S, KC_D, COMBO_END},
81// [_COLEMAK] = {KC_R, KC_S, COMBO_END},
82// [_QWOC] = {CM_S, CM_D, COMBO_END},
83// };
84
85// combo_t PROGMEM key_combos[COMBO_COUNT] = {
86// [CB_SUPERDUPER] = COMBO_ACTION(superduper_combos[_QWERTY]),
87// };
88
89// volatile bool superduper_enabled = true;
90
91// const uint16_t empty_combo[] = {COMBO_END};
92
93// void set_superduper_key_combos(void);
94// void clear_superduper_key_combos(void);
95
96const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
97/* Qwerty
98 *
99 * ,--------------------------------------------------. ,--------------------------------------------------.
100 * | ` | 1 | 2 | 3 | 4 | 5 | Mdia | | Mdia | 6 | 7 | 8 | 9 | 0 | - |
101 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
102 * | Tab | Q | W | E | R | T | Symb | | Symb | Y | U | I | O | P | \ |
103 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
104 * | Hp/Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
105 * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
106 * | Sft/( | Z/Mo | X | C | V | B | | | | N | M | , | . | SD-/ | Sft/) |
107 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
108 * |Rse/[ | Ctrl | Alt | Gui/_| Lwr | | Rse | GUI/-| Alt | Ctrl | Low/] |
109 * `----------------------------------' `----------------------------------'
110 * ,-------------. ,-------------.
111 * | Enter| LGui | | Alt |Ctrl/Esc|
112 * ,------|------|------| |------+--------+------.
113 * | | | Home | | PgUp | | |
114 * | Space| Back |------| |------| Back |Enter |
115 * | | Space| End | | PgDn | Space | |
116 * `--------------------' `----------------------'
117 */
118[_QWERTY] = KEYMAP(
119 // left hand
120 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, LT(_MDIA, KC_NO),
121 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, LT(_SYMB, KC_NO),
122 HPR_ESC, KC_A, LT(_SUPER, KC_S), LT(_DUPER, KC_D), KC_F, KC_G,
123 SFT_PO, LT(_MOUSE, KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
124 LT(_RAISE, KC_LBRC),KC_LCTL, KC_LALT, GUI_UNDS, LOWER,
125 KC_ENT, KC_LGUI,
126 KC_HOME,
127 KC_SPC,KC_BSPC,KC_END,
128 // right hand
129 LT(_MDIA, KC_NO), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
130 LT(_SYMB, KC_NO), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
131 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
132 MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, LT(_SUPERDUPER, KC_SLSH), SFT_PC,
133 RAISE, GUI_MINS,KC_RALT,KC_RCTL, LT(_LOWER, KC_RBRC),
134 KC_LALT, CTL_T(KC_ESC),
135 KC_PGUP,
136 KC_PGDN,KC_BSPC, KC_ENT
137 ),
138/* Colemak
139 *
140 * ,--------------------------------------------------. ,--------------------------------------------------.
141 * | ` | 1 | 2 | 3 | 4 | 5 | Mdia | | Mdia | 6 | 7 | 8 | 9 | 0 | - |
142 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
143 * | Tab | Q | W | F | P | G | Symb | | Symb | J | L | U | Y | ; | \ |
144 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
145 * | Hp/Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' |
146 * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
147 * | Sft/( | Z/Mo | X | C | V | B | | | | K | M | , | . | SD-/ | Sft/) |
148 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
149 * |Rse/[ | Ctrl | Alt | Gui/_| Lwr | | Rse | GUI/-| Alt | Ctrl | Low/] |
150 * `----------------------------------' `----------------------------------'
151 * ,-------------. ,-------------.
152 * | Enter| LGui | | Alt |Ctrl/Esc|
153 * ,------|------|------| |------+--------+------.
154 * | | | Home | | PgUp | | |
155 * | Space| Back |------| |------| Back |Enter |
156 * | | Space| End | | PgDn | Space | |
157 * `--------------------' `----------------------'
158 */
159[_COLEMAK] = KEYMAP(
160 // left hand
161 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, LT(_MDIA, KC_NO),
162 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, LT(_SYMB, KC_NO),
163 HPR_ESC, KC_A, LT(_SUPER,KC_R), LT(_DUPER,KC_S), KC_T, KC_D,
164 SFT_PO, LT(_MOUSE, KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO),
165 LT(_RAISE, KC_LBRC),KC_LCTL, KC_LALT, GUI_UNDS, LOWER,
166 KC_ENT, KC_LGUI,
167 KC_HOME,
168 KC_SPC,KC_BSPC,KC_END,
169 // right hand
170 LT(_MDIA, KC_NO), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
171 LT(_SYMB, KC_NO), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS,
172 KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
173 MEH_T(KC_NO),KC_K, KC_M, KC_COMM,KC_DOT, LT(_SUPERDUPER, KC_SLSH), SFT_PC,
174 RAISE, GUI_MINS,KC_RALT,KC_RCTL, LT(_LOWER, KC_RBRC),
175 KC_LALT, CTL_T(KC_ESC),
176 KC_PGUP,
177 KC_PGDN,KC_BSPC, KC_ENT
178 ),
179/* Qwerty on software Colemak : Useful for gaming with qwerty keymaps! */
180[_QWOC] = KEYMAP(
181 // left hand
182 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, LT(_MDIA, KC_NO),
183 KC_TAB, CM_Q, CM_W, CM_E, CM_R, CM_T, LT(_SYMB, KC_NO),
184 HPR_ESC, CM_A, LT(_SUPER,CM_S), LT(_DUPER,CM_D), CM_F, CM_G,
185 SFT_PO, LT(_MOUSE, CM_Z), CM_X, CM_C, CM_V, CM_B, ALL_T(KC_NO),
186 LT(_RAISE, KC_LBRC),KC_LCTL, KC_LALT, GUI_UNDS, LOWER,
187 KC_ENT, KC_LGUI,
188 KC_HOME,
189 KC_SPC,KC_BSPC,KC_END,
190 // right hand
191 LT(_MDIA, KC_NO), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
192 LT(_SYMB, KC_NO), CM_Y, CM_U, CM_I, CM_O, CM_P, KC_BSLS,
193 CM_H, CM_J, CM_K, CM_L, CM_SCLN, KC_QUOT,
194 MEH_T(KC_NO),CM_N, CM_M, CM_COMM,CM_DOT, LT(_SUPERDUPER, KC_SLSH), SFT_PC,
195 RAISE, GUI_MINS,KC_RALT,KC_RCTL, LT(_LOWER, KC_RBRC),
196 KC_LALT, CTL_T(KC_ESC),
197 KC_PGUP,
198 KC_PGDN,KC_BSPC, KC_ENT
199 ),
200/* Lower
201 *
202 * ,--------------------------------------------------. ,--------------------------------------------------.
203 * | | | | | | | | | | | | | | | |
204 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
205 * | | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | |
206 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
207 * | | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | _ | + | { | } | | |
208 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
209 * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | | | |
210 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
211 * | | | | | | | | | | | |
212 * `----------------------------------' `----------------------------------'
213 * ,-------------. ,-------------.
214 * | | | | | |
215 * ,------|------|------| |------+------+------.
216 * | | | | | | | |
217 * | | |------| |------| | |
218 * | | | | | | | |
219 * `--------------------' `--------------------'
220 */
221[_LOWER] = KEYMAP(
222 _______, _______, _______, _______, _______, _______, _______,
223 _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______,
224 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,
225 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______,
226 _______, _______, _______, KC_BTN1, KC_BTN2,
227 _______, _______,
228 _______,
229 _______, _______, _______,
230 // right hand
231 _______, _______, _______, _______, _______, _______, _______,
232 _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
233 KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
234 _______, KC_F12,S(KC_NUHS),S(KC_NUBS), _______, _______, _______,
235 _______, _______, _______, _______, _______,
236 _______, _______,
237 _______,
238 _______, _______, _______
239),
240/* Raise
241 *
242 * ,--------------------------------------------------. ,--------------------------------------------------.
243 * | | | | | | | | | | | | | | | |
244 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
245 * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | |
246 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
247 * | | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | - | = | [ | ] | \ |
248 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
249 * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | | | |
250 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
251 * | | | | | | | | | | | |
252 * `----------------------------------' `----------------------------------'
253 * ,-------------. ,-------------.
254 * | | | | | |
255 * ,------|------|------| |------+------+------.
256 * | | | | | | | |
257 * | | |------| |------| | |
258 * | | | | | | | |
259 * `--------------------' `--------------------'
260 */
261[_RAISE] = KEYMAP(
262 _______, _______, _______, _______, _______, _______, _______,
263 _______, KC_1, KC_2, KC_3, KC_4, KC_5, _______,
264 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,
265 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______,
266 _______, _______, _______, KC_BTN1, KC_BTN2,
267 _______, _______,
268 _______,
269 _______, _______, _______,
270 // right hand
271 _______, _______, _______, _______, _______, _______, _______,
272 _______, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
273 KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
274 _______, KC_F12,S(KC_NUHS),S(KC_NUBS), _______, _______, _______,
275 _______, _______, _______, _______, _______,
276 _______, _______,
277 _______,
278 _______, _______, _______
279),
280
281/* Plover
282 *
283 * ,--------------------------------------------------. ,--------------------------------------------------.
284 * | # | # | # | # | # | # | | | | # | # | # | # | # | # |
285 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
286 * | | # | # | # | # | # | | | | # | # | # | # | # | # |
287 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
288 * | Hp/Esc | S | T | P | H | * |------| |------| * | F | P | L | T | D |
289 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
290 * | Sft/( | S | K | W | R | * | | | | * | R | B | G | S | Z |
291 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
292 * | Exit | | | A | O | | E | U | | | |
293 * `----------------------------------' `----------------------------------'
294 * ,-------------. ,-------------.
295 * | Enter| LGui | | Alt |Ctrl/Esc|
296 * ,------|------|------| |------+--------+------.
297 * | | | Home | | PgUp | | |
298 * | Space| Back |------| |------| Back |Enter |
299 * | | Space| End | | PgDn | Space | |
300 * `--------------------' `----------------------'
301 */
302[_PLOVER] = KEYMAP(
303 // left hand
304 KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, XXXXXXX,
305 XXXXXXX, KC_1, KC_1, KC_1, KC_1, KC_1, XXXXXXX,
306 XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T,
307 XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX,
308 EXT_PLV, XXXXXXX, XXXXXXX,KC_C, KC_V,
309 KC_ENT, KC_LGUI,
310 KC_HOME,
311 KC_SPC,KC_BSPC,KC_END,
312 // right hand
313 XXXXXXX, KC_1, KC_1, KC_1, KC_1, KC_1, XXXXXXX,
314 XXXXXXX, KC_1, KC_1, KC_1, KC_1, KC_1, XXXXXXX,
315 KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
316 XXXXXXX, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
317 KC_N, KC_M,XXXXXXX,XXXXXXX, XXXXXXX,
318 KC_LALT, CTL_T(KC_ESC),
319 KC_PGUP,
320 KC_PGDN,KC_BSPC, KC_ENT
321 ),
322
323/* SuperDuper : https://gist.github.com/narze/861e2167784842d38771
324 *
325 * ,--------------------------------------------------. ,--------------------------------------------------.
326 * | | | | | | | | | | | | | | | |
327 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
328 * | | | | | | | | | | | | T← | T→ | | |
329 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
330 * | | A | [SuperDuper]| Bksp | Gui |------| |------| ← | ↓ | ↑ | → | Del | |
331 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
332 * | | | | | | | | | | | | | | | |
333 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
334 * | | | | | | | | | | | |
335 * `----------------------------------' `----------------------------------'
336 * ,-------------. ,-------------.
337 * | | | | | |
338 * ,------|------|------| |------+--------+------.
339 * | | | | | | | |
340 * | Shift| |------| |------| |Shift |
341 * | | | | | | | |
342 * `--------------------' `----------------------'
343 */
344[_SUPERDUPER] = KEYMAP(
345 // left hand
346 _______, _______, _______, _______, _______, _______, _______,
347 _______, _______, _______, _______, _______, _______, _______,
348 _______, KC_LALT, _______, _______, KC_BSPC, KC_LGUI,
349 _______, _______, _______, _______, _______, _______, _______,
350 _______, _______, _______, _______, _______,
351 _______, _______,
352 _______,
353 KC_LSFT,_______,_______,
354 // right hand
355 _______, _______, _______, _______, _______, _______, _______,
356 _______, _______, _______, S(LGUI(KC_LBRC)), S(LGUI(KC_RBRC)), _______, _______,
357 KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, _______,
358 _______, _______, _______, _______, _______, _______, _______,
359 _______, _______, _______, _______, _______,
360 _______, _______,
361 _______,
362 _______,_______, KC_LSFT
363 ),
364// Intermediate keymaps for SuperDuper (Combo keys does not work on Infinity yet)
365[_SUPER] = KEYMAP(
366 // left hand
367 _______, _______, _______, _______, _______, _______, _______,
368 _______, _______, _______, _______, _______, _______, _______,
369 _______, _______, _______, DUPER, _______, _______,
370 _______, _______, _______, _______, _______, _______, _______,
371 _______, _______, _______, _______, _______,
372 _______, _______,
373 _______,
374 _______,_______,_______,
375 // right hand
376 _______, _______, _______, _______, _______, _______, _______,
377 _______, _______, _______, _______, _______, _______, _______,
378 _______, _______, _______, _______, _______, _______,
379 _______, _______, _______, _______, _______, _______, _______,
380 _______, _______, _______, _______, _______,
381 _______, _______,
382 _______,
383 _______,_______, _______
384 ),
385[_DUPER] = KEYMAP(
386 // left hand
387 _______, _______, _______, _______, _______, _______, _______,
388 _______, _______, _______, _______, _______, _______, _______,
389 _______, _______, SUPER, _______, _______, _______,
390 _______, _______, _______, _______, _______, _______, _______,
391 _______, _______, _______, _______, _______,
392 _______, _______,
393 _______,
394 _______,_______,_______,
395 // right hand
396 _______, _______, _______, _______, _______, _______, _______,
397 _______, _______, _______, _______, _______, _______, _______,
398 _______, _______, _______, _______, _______, _______,
399 _______, _______, _______, _______, _______, _______, _______,
400 _______, _______, _______, _______, _______,
401 _______, _______,
402 _______,
403 _______,_______, _______
404 ),
405
406/* Mouse
407 *
408 * ,--------------------------------------------------. ,--------------------------------------------------.
409 * | | | | | | | | | | | | | | | |
410 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
411 * | | | S↑ | M↑ | S↓ | | | | | | | S↑ | S↓ | | |
412 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
413 * | | | M← | M↓ | M→ | |------| |------| M← | M↓ | M↑ | M→ | | |
414 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
415 * | |[Mouse| | | | M3 | | | | M3 | | | | | |
416 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
417 * | | | | | M2 | | M2 | | | | |
418 * `----------------------------------' `----------------------------------'
419 * ,-------------. ,-------------.
420 * | | | | | |
421 * ,------|------|------| |------+--------+------.
422 * | | | | | | | |
423 * | Left | |------| |------| | Left |
424 * | Click| | | | | | Click|
425 * `--------------------' `----------------------'
426 */
427[_MOUSE] = KEYMAP(
428 // left hand
429 _______, _______, _______, _______, _______, _______, _______,
430 _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______,
431 _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______,
432 _______, _______, _______, _______, _______, KC_BTN3, _______,
433 _______, _______, _______, _______, KC_BTN2,
434 _______, _______,
435 _______,
436 KC_BTN1,_______,_______,
437 // right hand
438 _______, _______, _______, _______, _______, _______, _______,
439 _______, _______, _______, KC_WH_U, KC_WH_D, _______, _______,
440 KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______,
441 _______, KC_BTN3, _______, _______, _______, _______, _______,
442 KC_BTN2, _______, _______, _______, _______,
443 _______, _______,
444 _______,
445 _______,_______, KC_BTN1
446 ),
447
448/* Adjust (Lower + Raise)
449 *
450 * ,--------------------------------------------------. ,--------------------------------------------------.
451 * | | | | | | | | | | | | | | | |
452 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
453 * | |Reset | | | | | | | | | | | | | Del |
454 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
455 * | | | | | |AGnorm|------| |------|AGswap|Qwerty|Colemk|QwOnCo|Plover| |
456 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
457 * | | | | | | | | | |SDTogg| | | | | |
458 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
459 * | | | | | | | | | | | |
460 * `----------------------------------' `----------------------------------'
461 * ,-------------. ,-------------.
462 * | | | | | |
463 * ,------|------|------| |------+--------+------.
464 * | | | | | | | |
465 * | | |------| |------| | |
466 * | | | | | | | |
467 * `--------------------' `----------------------'
468 */
469[_ADJUST] = KEYMAP(
470 // left hand
471 _______, _______, _______, _______, _______, _______, _______,
472 _______, RESET, _______, _______, _______, _______, _______,
473 _______, _______, _______, _______, _______, AG_NORM,
474 _______, _______, _______, _______, _______, _______, _______,
475 _______, _______, _______, _______, _______,
476 _______, _______,
477 _______,
478 _______,_______,_______,
479 // right hand
480 _______, _______, _______, _______, _______, _______, _______,
481 _______, _______, _______, _______, _______, _______, KC_DEL,
482 AG_SWAP, QWERTY, COLEMAK, QWOC, PLOVER, _______,
483 _______, SDTOGG, _______, _______, _______, _______, _______,
484 _______, _______, _______, _______, _______,
485 _______, _______,
486 _______,
487 _______,_______, _______
488 ),
489
490/* Layers below are not actively used but kept for future reference */
491
492/* Symbol
493 * ,---------------------------------------------------. ,--------------------------------------------------.
494 * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
495 * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
496 * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
497 * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
498 * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
499 * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
500 * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
501 * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
502 * | EPRM | | | | | | | . | 0 | = | |
503 * `-----------------------------------' `----------------------------------'
504 * ,-------------. ,-------------.
505 * |Animat| | |Toggle|Solid |
506 * ,------|------|------| |------+------+------.
507 * |Bright|Bright| | | |Hue- |Hue+ |
508 * |ness- |ness+ |------| |------| | |
509 * | | | | | | | |
510 * `--------------------' `--------------------'
511 */
512// SYMBOLS
513[_SYMB] = KEYMAP(
514 // left hand
515 VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
516 _______,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,_______,
517 _______,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV,
518 _______,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,_______,
519 EPRM,_______,_______,_______,_______,
520 RGB_MOD,_______,
521 _______,
522 RGB_VAD,RGB_VAI,_______,
523 // right hand
524 _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
525 _______, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
526 KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______,
527 _______, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, _______,
528 _______,KC_DOT, KC_0, KC_EQL, _______,
529 RGB_TOG, RGB_SLD,
530 _______,
531 _______, RGB_HUD, RGB_HUI
532),
533/* Media and mouse keys
534 *
535 * ,--------------------------------------------------. ,--------------------------------------------------.
536 * | | | | | | | | | | | | | | | |
537 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
538 * | | | | MsUp | | | | | | | | | | | |
539 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
540 * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play |
541 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
542 * | | | | | | | | | | | | Prev | Next | | |
543 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
544 * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
545 * `----------------------------------' `----------------------------------'
546 * ,-------------. ,-------------.
547 * | | | | | |
548 * ,------|------|------| |------+------+------.
549 * | | | | | | |Brwser|
550 * | | |------| |------| |Back |
551 * | | | | | | | |
552 * `--------------------' `--------------------'
553 */
554// MEDIA AND MOUSE
555[_MDIA] = KEYMAP(
556 _______, _______, _______, _______, _______, _______, _______,
557 _______, _______, _______, KC_MS_U, _______, _______, _______,
558 _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______,
559 _______, _______, _______, _______, _______, _______, _______,
560 _______, _______, _______, KC_BTN1, KC_BTN2,
561 _______, _______,
562 _______,
563 _______, _______, _______,
564 // right hand
565 _______, _______, _______, _______, _______, _______, _______,
566 _______, _______, _______, _______, _______, _______, _______,
567 _______, _______, _______, _______, _______, KC_MPLY,
568 _______, _______, _______, KC_MPRV, KC_MNXT, _______, _______,
569 KC_VOLU, KC_VOLD, KC_MUTE, _______, _______,
570 _______, _______,
571 _______,
572 _______, _______, KC_WBAK
573)
574};
575
576void persistant_default_layer_set(uint16_t default_layer) {
577 eeconfig_update_default_layer(default_layer);
578 default_layer_set(default_layer);
579}
580
581bool process_record_user(uint16_t keycode, keyrecord_t *record) {
582 switch (keycode) {
583 case QWERTY:
584 if (record->event.pressed) {
585 persistant_default_layer_set(1UL<<_QWERTY);
586
587 // key_combos[CB_SUPERDUPER].keys = superduper_combos[_QWERTY];
588 // eeprom_update_byte(EECONFIG_SUPERDUPER_INDEX, _QWERTY);
589 }
590 return false;
591 break;
592 case COLEMAK:
593 if (record->event.pressed) {
594 persistant_default_layer_set(1UL<<_COLEMAK);
595
596 // key_combos[CB_SUPERDUPER].keys = superduper_combos[_COLEMAK];
597 // eeprom_update_byte(EECONFIG_SUPERDUPER_INDEX, _COLEMAK);
598 }
599 return false;
600 break;
601 case QWOC:
602 if (record->event.pressed) {
603 persistant_default_layer_set(1UL<<_QWOC);
604
605 // key_combos[CB_SUPERDUPER].keys = superduper_combos[_QWOC];
606 // eeprom_update_byte(EECONFIG_SUPERDUPER_INDEX, _QWOC);
607 }
608 return false;
609 break;
610 case LOWER:
611 if (record->event.pressed) {
612 layer_on(_LOWER);
613 update_tri_layer(_LOWER, _RAISE, _ADJUST);
614 } else {
615 layer_off(_LOWER);
616 update_tri_layer(_LOWER, _RAISE, _ADJUST);
617 }
618 return false;
619 break;
620 case RAISE:
621 if (record->event.pressed) {
622 layer_on(_RAISE);
623 update_tri_layer(_LOWER, _RAISE, _ADJUST);
624 } else {
625 layer_off(_RAISE);
626 update_tri_layer(_LOWER, _RAISE, _ADJUST);
627 }
628 return false;
629 break;
630 case SUPER:
631 if (record->event.pressed) {
632 layer_on(_SUPER);
633 update_tri_layer(_SUPER, _DUPER, _SUPERDUPER);
634 } else {
635 layer_off(_SUPER);
636 update_tri_layer(_SUPER, _DUPER, _SUPERDUPER);
637 }
638 return false;
639 break;
640 case DUPER:
641 if (record->event.pressed) {
642 layer_on(_DUPER);
643 update_tri_layer(_SUPER, _DUPER, _SUPERDUPER);
644 } else {
645 layer_off(_DUPER);
646 update_tri_layer(_SUPER, _DUPER, _SUPERDUPER);
647 }
648 return false;
649 break;
650 case BACKLIT:
651 if (record->event.pressed) {
652 register_code(KC_RSFT);
653 #ifdef BACKLIGHT_ENABLE
654 backlight_step();
655 #endif
656 } else {
657 unregister_code(KC_RSFT);
658 }
659 return false;
660 break;
661 case PLOVER:
662 if (record->event.pressed) {
663 layer_off(_RAISE);
664 layer_off(_LOWER);
665 layer_off(_ADJUST);
666 layer_on(_PLOVER);
667 if (!eeconfig_is_enabled()) {
668 eeconfig_init();
669 }
670 keymap_config.raw = eeconfig_read_keymap();
671 keymap_config.nkro = 1;
672 eeconfig_update_keymap(keymap_config.raw);
673 }
674 return false;
675 break;
676 case EXT_PLV:
677 if (record->event.pressed) {
678 layer_off(_PLOVER);
679 }
680 return false;
681 break;
682 case SDTOGG:
683 if (record->event.pressed) {
684 // superduper_enabled = !superduper_enabled;
685
686 // if (superduper_enabled) {
687 // set_superduper_key_combos();
688 // } else {
689 // clear_superduper_key_combos();
690 // }
691 }
692 return false;
693 break;
694 case EPRM:
695 if (record->event.pressed) {
696 eeconfig_init();
697 }
698 return false;
699 break;
700 case VRSN:
701 if (record->event.pressed) {
702 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
703 }
704 return false;
705 break;
706 case RGB_SLD:
707 if (record->event.pressed) {
708 #ifdef RGBLIGHT_ENABLE
709 rgblight_mode(1);
710 #endif
711 }
712 return false;
713 break;
714 }
715 return true;
716}
717
718void matrix_init_user(void) {
719
720}
721
722void matrix_setup(void) {
723 // set_superduper_key_combos();
724}
725
726// void set_superduper_key_combos(void) {
727// uint8_t layer = eeprom_read_byte(EECONFIG_SUPERDUPER_INDEX);
728
729// switch (layer) {
730// case _QWERTY:
731// case _COLEMAK:
732// case _QWOC:
733// key_combos[CB_SUPERDUPER].keys = superduper_combos[layer];
734// break;
735// }
736// }
737
738// void clear_superduper_key_combos(void) {
739// key_combos[CB_SUPERDUPER].keys = empty_combo;
740// }
741
742void matrix_scan_user(void) {
743 // uint8_t layer = biton32(layer_state);
744
745 // ergodox_board_led_off();
746 // ergodox_right_led_1_off();
747 // ergodox_right_led_2_off();
748 // ergodox_right_led_3_off();
749 // switch (layer) {
750 // // TODO: Make this relevant to the ErgoDox EZ.
751 // case 1:
752 // ergodox_right_led_1_on();
753 // break;
754 // case 2:
755 // ergodox_right_led_2_on();
756 // break;
757 // default:
758 // // none
759 // break;
760 // }
761}
762
763// Combos
764
765// void process_combo_event(uint8_t combo_index, bool pressed) {
766// if (pressed) {
767// switch(combo_index) {
768// case CB_SUPERDUPER:
769// layer_on(_SUPERDUPER);
770// ergodox_board_led_on();
771// break;
772// }
773// } else {
774// layer_off(_SUPERDUPER);
775// ergodox_board_led_off();
776// unregister_mods(MOD_BIT(KC_LGUI) | MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); // Sometimes mods are held, unregister them
777// }
778// }
779
780// Macros
781
782const uint16_t PROGMEM fn_actions[] = {
783 [M_GUI_UNDS] = ACTION_MACRO_TAP(M_GUI_UNDS),
784 [M_SFT_PO] = ACTION_MACRO_TAP(M_SFT_PO),
785 [M_SFT_PC] = ACTION_MACRO_TAP(M_SFT_PC),
786};
787
788const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
789{
790 bool tap_not_interrupted = record->tap.count > 0 && !record->tap.interrupted;
791
792 switch(id) {
793 // Hold for LGUI, tap for Underscore
794 case M_GUI_UNDS:
795 if (record->event.pressed) {
796 m_gui_unds_timer = timer_read();
797
798 if (!tap_not_interrupted) {
799 register_mods(MOD_BIT(KC_LGUI));
800 }
801 } else {
802 if (tap_not_interrupted && timer_elapsed(m_gui_unds_timer) < TAPPING_TERM) {
803
804 add_weak_mods(MOD_BIT(KC_LSFT));
805 send_keyboard_report();
806 register_code(KC_MINS);
807 unregister_code(KC_MINS);
808 del_weak_mods(MOD_BIT(KC_LSFT));
809 send_keyboard_report();
810 record->tap.count = 0; // ad hoc: cancel tap
811 } else {
812 unregister_mods(MOD_BIT(KC_LGUI));
813 }
814 }
815 break;
816 // Hold for LSHIFT, tap for Parens open
817 case M_SFT_PO:
818 if (record->event.pressed) {
819 m_sft_po_timer = timer_read();
820
821 if (!tap_not_interrupted) {
822 register_mods(MOD_BIT(KC_LSFT));
823 }
824 } else {
825 if (tap_not_interrupted && timer_elapsed(m_sft_po_timer) < TAPPING_TERM) {
826 record->tap.count = 0;
827 return MACRO(D(RSFT), T(9), U(RSFT), END);
828 } else {
829 unregister_mods(MOD_BIT(KC_LSFT));
830 }
831 }
832 break;
833 // Hold for RSHIFT, tap for Parens close
834 case M_SFT_PC:
835 if (record->event.pressed) {
836 m_sft_pc_timer = timer_read();
837
838 if (!tap_not_interrupted) {
839 register_mods(MOD_BIT(KC_RSFT));
840 }
841 } else {
842 if (tap_not_interrupted && timer_elapsed(m_sft_pc_timer) < TAPPING_TERM) {
843 record->tap.count = 0;
844 return MACRO(D(LSFT), T(0), U(LSFT), END);
845 } else {
846 unregister_mods(MOD_BIT(KC_RSFT));
847 }
848 }
849 break;
850 }
851 return MACRO_NONE;
852};
diff --git a/keyboards/ergodox/keymaps/narze/readme.md b/keyboards/ergodox/keymaps/narze/readme.md
new file mode 100644
index 000000000..03a72f1ac
--- /dev/null
+++ b/keyboards/ergodox/keymaps/narze/readme.md
@@ -0,0 +1,45 @@
1# narze's layout
2
3## Notes
4- SuperDuper mode for Ergodox is still under development, since combo keys does not work very well on Ergodox firmware.
5 Now it is using multiple layers as a workaround. Actual implementation using combos are on my Planck layout.
6
7## Key features
8- Qwerty + [Colemak](https://colemak.com) layouts, and you can type Qwerty on software-level Colemak as well. Very useful for gaming or when your friend wanna type something but don't use Colemak.
9- [(S)uper (D)uper Mode](https://github.com/jasonrudolph/keyboard#super-duper-mode) inspired by [jasonrudolph](https://github.com/jasonrudolph), with [some extensions](https://gist.github.com/narze/861e2167784842d38771) such as backspace & forward delete.
10- Mouse keys with Z
11
12## (S)uper (D)uper Mode
13Press `S+D` simultaneously and hold, then...
14- `H/J/K/L` for Vim-like movement
15- `I/O` to move between browser tabs (Not working on Windows yet)
16- `A` for `Option (Alt)`
17- `F/;` for `Backspace/Forward delete`
18- `A` with `H/L` to move to previous/next word
19- `A` with `G/;` to delete to previous/next word
20- `G` for `Cmd` (Gui/Windows)
21- Available for all layouts (but plover) using physical S & D keys position in qwerty
22- `Spacebar` for `Shift` (it's easier when already holding A with your pinky)
23- Disable with `Raise+Lower+M`
24- You can edit or add more useful keys in SUPERDUPER layer
25- It can be activated by holding `/` as well, but it's slower since `LT()` uses `TAPPING_TERM` of 200ms but `S+D` uses `COMBO_TERM` of only 20ms (Can be changed within config.h)
26
27## Build instructions
28- `cd /path/to/qmk_firmware`
29
30#### Left side
31 ```
32docker run -e keymap=narze -e subproject=infinity -e keyboard=ergodox --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware
33avr-objcopy -Iihex -Obinary .build/ergodox_infinity_narze.hex .build/ergodox_infinity_narze_left.bin
34dfu-util --device 1c11:b007 -D .build/ergodox_infinity_narze_left.bin
35```
36
37#### Right side
38```
39docker run -e keymap=narze -e subproject=infinity -e keyboard=ergodox -e MASTER=right --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware
40avr-objcopy -Iihex -Obinary .build/ergodox_infinity_narze.hex .build/ergodox_infinity_narze_right.bin
41dfu-util --device 1c11:b007 -D .build/ergodox_infinity_narze_right.bin
42```
43
44## TODO
45- [ ] Make SuperDuper mode fully-compatible in Windows by swapping GUI with Ctrl
diff --git a/keyboards/ergodox/keymaps/narze/rules.mk b/keyboards/ergodox/keymaps/narze/rules.mk
new file mode 100644
index 000000000..7d2e00d0e
--- /dev/null
+++ b/keyboards/ergodox/keymaps/narze/rules.mk
@@ -0,0 +1,24 @@
1
2
3# Build Options
4# change to "no" to disable the options, or define them in the Makefile in
5# the appropriate keymap folder that will get included automatically
6#
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
13BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls
15AUDIO_ENABLE = no # Audio output on port C6
16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22
23# Combos not working yet
24COMBO_ENABLE = no
diff --git a/keyboards/ergodox/keymaps/narze/visualizer.c b/keyboards/ergodox/keymaps/narze/visualizer.c
new file mode 100644
index 000000000..88f658d6b
--- /dev/null
+++ b/keyboards/ergodox/keymaps/narze/visualizer.c
@@ -0,0 +1,94 @@
1/*
2Copyright 2017 Fred Sundvik
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "simple_visualizer.h"
19#include "util.h"
20
21// Copied from keymap.c
22enum ergodox_layers {
23 _QWERTY,
24 _COLEMAK,
25 _QWOC,
26 _LOWER,
27 _RAISE,
28 _PLOVER,
29// Intermediate layers for SuperDuper (Combo keys does not work on Infinity yet)
30 _SUPER,
31 _DUPER,
32 _SUPERDUPER,
33 _MOUSE,
34 _ADJUST,
35 _MDIA,
36 _SYMB,
37};
38
39// This function should be implemented by the keymap visualizer
40// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing
41// that the simple_visualizer assumes that you are updating
42// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is
43// stopped. This can be done by either double buffering it or by using constant strings
44static void get_visualizer_layer_and_color(visualizer_state_t* state) {
45 uint8_t saturation = 255;
46
47 uint8_t layer = biton32(state->status.layer);
48 state->target_lcd_color = LCD_COLOR(layer << 2, saturation, 0xFF);
49
50 switch(layer) {
51 case _QWERTY:
52 state->layer_text = "QWERTY";
53 break;
54 case _COLEMAK:
55 state->layer_text = "COLEMAK";
56 break;
57 case _QWOC:
58 state->layer_text = "QWERTY on COLEMAK";
59 break;
60 case _LOWER:
61 state->layer_text = "LOWER";
62 break;
63 case _RAISE:
64 state->layer_text = "RAISE";
65 break;
66 case _PLOVER:
67 state->layer_text = "PLOVER";
68 break;
69 case _SUPERDUPER:
70 state->layer_text = "SUPERDUPER";
71 break;
72 case _SUPER:
73 state->layer_text = "SUPER";
74 break;
75 case _DUPER:
76 state->layer_text = "DUPER";
77 break;
78 case _MOUSE:
79 state->layer_text = "MOUSE";
80 break;
81 case _ADJUST:
82 state->layer_text = "ADJUST";
83 break;
84 case _MDIA:
85 state->layer_text = "MDIA";
86 break;
87 case _SYMB:
88 state->layer_text = "SYMB";
89 break;
90 default:
91 state->layer_text = "NONE";
92 break;
93 }
94}
diff --git a/keyboards/planck/keymaps/narze/config.h b/keyboards/planck/keymaps/narze/config.h
new file mode 100644
index 000000000..e081a93b5
--- /dev/null
+++ b/keyboards/planck/keymaps/narze/config.h
@@ -0,0 +1,42 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#define TAPPING_TERM 200
30
31#define COMBO_TERM 20
32#define COMBO_COUNT 1
33
34#define IGNORE_MOD_TAP_INTERRUPT
35#define PERMISSIVE_HOLD
36#define PREVENT_STUCK_MODIFIERS
37
38#define SUPER_DUPER_SOUND S__NOTE(_B1)
39
40#define MOUSEKEY_DELAY 100
41
42#endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/narze/keymap.c b/keyboards/planck/keymaps/narze/keymap.c
new file mode 100644
index 000000000..c5703f58d
--- /dev/null
+++ b/keyboards/planck/keymaps/narze/keymap.c
@@ -0,0 +1,524 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "planck.h"
5#include "action_layer.h"
6#ifdef AUDIO_ENABLE
7 #include "audio.h"
8#endif
9#include "eeconfig.h"
10#include "keymap_colemak.h"
11
12extern keymap_config_t keymap_config;
13
14// Each layer gets a name for readability, which is then used in the keymap matrix below.
15// The underscores don't mean anything - you can have a layer called STUFF or any other name.
16// Layer names don't all need to be of the same length, obviously, and you can also skip them
17// entirely and just use numbers.
18
19enum planck_layers {
20 _QWERTY,
21 _COLEMAK,
22 _QWOC,
23 _LOWER,
24 _RAISE,
25 _PLOVER,
26 _SUPERDUPER,
27 _MOUSE,
28 _ADJUST
29};
30
31enum planck_keycodes {
32 QWERTY = SAFE_RANGE,
33 COLEMAK,
34 QWOC,
35 PLOVER,
36 SUPERDUPER,
37 MOUSE,
38 LOWER,
39 RAISE,
40 BACKLIT,
41 EXT_PLV,
42 SDTOGG, // Toggle SuperDuper
43};
44
45enum functions {
46 M_GUI_UNDS, // Simulate GUI_T(KC_UNDS)
47 M_SFT_PO, // SFT_T(KC_LPRN)
48};
49
50// Timer for custom mod tap
51static uint16_t m_gui_unds_timer;
52static uint16_t m_sft_po_timer;
53
54// Fillers to make layering more clear
55#define _______ KC_TRNS
56#define XXXXXXX KC_NO
57
58// Narze : Custom Macros
59#define HPR_ESC ALL_T(KC_ESC)
60#define SFT_ENT SFT_T(KC_ENT)
61#define SFT_PO F(M_SFT_PO)
62#define GUI_MINS GUI_T(KC_MINS)
63#define GUI_UNDS F(M_GUI_UNDS)
64
65// Combo : SuperDuper layer from S+D (R+S in Colemak)
66#define SUPERDUPER_COMBO_COUNT 3
67#define EECONFIG_SUPERDUPER_INDEX (uint8_t *) 19
68
69enum process_combo_event {
70 CB_SUPERDUPER,
71};
72
73const uint16_t PROGMEM superduper_combos[SUPERDUPER_COMBO_COUNT][3] = {
74 [_QWERTY] = {KC_S, KC_D, COMBO_END},
75 [_COLEMAK] = {KC_R, KC_S, COMBO_END},
76 [_QWOC] = {CM_S, CM_D, COMBO_END},
77};
78
79combo_t key_combos[COMBO_COUNT] = {
80 [CB_SUPERDUPER] = COMBO_ACTION(superduper_combos[_QWERTY]),
81};
82
83volatile bool superduper_enabled = true;
84
85const uint16_t empty_combo[] = {COMBO_END};
86
87void set_superduper_key_combos(void);
88void clear_superduper_key_combos(void);
89
90const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
91
92/* Qwerty
93 * ,-----------------------------------------------------------------------------------.
94 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
95 * |------+------+------+------+------+-------------+------+------+------+------+------|
96 * | Hp/Ec| A | S | D | F | G | H | J | K | L | ; | ' |
97 * |------+------+------+------+------+------|------+------+------+------+------+------|
98 * | Sft/(| Z/Mo | X | C | V | B | N | M | , | . | SD-/ |Sft/Ent|
99 * |------+------+------+------+------+------+------+------+------+------+------+------|
100 * | Rse/[| Ctrl | Alt | GUI/_|Lower | Space |Raise | GUI/-| Alt | Ctrl | Low/]|
101 * `-----------------------------------------------------------------------------------'
102 */
103[_QWERTY] = {
104 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
105 {HPR_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
106 {SFT_PO, LT(_MOUSE, KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, LT(_SUPERDUPER, KC_SLSH), SFT_ENT},
107 {LT(_RAISE, KC_LBRC), KC_LCTL, KC_LALT, GUI_UNDS, LOWER, KC_SPC, KC_SPC, RAISE, GUI_MINS, KC_RALT, KC_RCTL, LT(_LOWER, KC_RBRC)}
108},
109
110/* Colemak
111 * ,-----------------------------------------------------------------------------------.
112 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
113 * |------+------+------+------+------+-------------+------+------+------+------+------|
114 * | Hp/Ec| A | R | S | T | D | H | N | E | I | O | ' |
115 * |------+------+------+------+------+------|------+------+------+------+------+------|
116 * | Sft/(| Z/Mo | X | C | V | B | K | M | , | . | SD-/ |Sft/Ent|
117 * |------+------+------+------+------+------+------+------+------+------+------+------|
118 * | Brite| Ctrl | Alt | GUI/_|Lower | Space |Raise | GUI/-| Alt | Ctrl | Low/]|
119 * `-----------------------------------------------------------------------------------'
120 */
121[_COLEMAK] = {
122 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
123 {HPR_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
124 {SFT_PO, LT(_MOUSE, KC_Z), KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, LT(_SUPERDUPER, KC_SLSH), SFT_ENT},
125 {LT(_RAISE, KC_LBRC), KC_LCTL, KC_LALT, GUI_UNDS, LOWER, KC_SPC, KC_SPC, RAISE, GUI_MINS, KC_RALT, KC_RCTL, LT(_LOWER, KC_RBRC)}
126},
127
128/* Qwerty on software Colemak : Useful for gaming with qwerty keymaps! */
129[_QWOC] = {
130 {KC_TAB, CM_Q, CM_W, CM_E, CM_R, CM_T, CM_Y, CM_U, CM_I, CM_O, CM_P, KC_BSPC},
131 {HPR_ESC, CM_A, CM_S, CM_D, CM_F, CM_G, CM_H, CM_J, CM_K, CM_L, CM_SCLN, KC_QUOT},
132 {SFT_PO, LT(_MOUSE, CM_Z), CM_X, CM_C, CM_V, CM_B, CM_N, CM_M, CM_COMM, CM_DOT, LT(_SUPERDUPER, CM_SLSH), SFT_ENT},
133 {LT(_RAISE, KC_LBRC), KC_LCTL, KC_LALT, GUI_UNDS, LOWER, KC_SPC, KC_SPC, RAISE, GUI_MINS, KC_RALT, KC_RCTL, LT(_LOWER, KC_RBRC)}
134},
135
136/* Lower
137 * ,-----------------------------------------------------------------------------------.
138 * | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
139 * |------+------+------+------+------+-------------+------+------+------+------+------|
140 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
141 * |------+------+------+------+------+------|------+------+------+------+------+------|
142 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Sft/Ent|
143 * |------+------+------+------+------+------+------+------+------+------+------+------|
144 * | | | | | | | | Next | Vol- | Vol+ | Play |
145 * `-----------------------------------------------------------------------------------'
146 */
147[_LOWER] = {
148 {KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
149 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
150 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______},
151 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
152},
153
154/* Raise
155 * ,-----------------------------------------------------------------------------------.
156 * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
157 * |------+------+------+------+------+-------------+------+------+------+------+------|
158 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
159 * |------+------+------+------+------+------|------+------+------+------+------+------|
160 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Sft/Ent|
161 * |------+------+------+------+------+------+------+------+------+------+------+------|
162 * | | | | | | | | Next | Vol- | Vol+ | Play |
163 * `-----------------------------------------------------------------------------------'
164 */
165[_RAISE] = {
166 {KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
167 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
168 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______},
169 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
170},
171
172/* Plover layer (http://opensteno.org)
173 * ,-----------------------------------------------------------------------------------.
174 * | # | # | # | # | # | # | # | # | # | # | # | # |
175 * |------+------+------+------+------+-------------+------+------+------+------+------|
176 * | | S | T | P | H | * | * | F | P | L | T | D |
177 * |------+------+------+------+------+------|------+------+------+------+------+------|
178 * |TogOut| S | K | W | R | * | * | R | B | G | S | Z |
179 * |------+------+------+------+------+------+------+------+------+------+------+------|
180 * | Exit | | | A | O | | E | U | | | |
181 * `-----------------------------------------------------------------------------------'
182 */
183
184[_PLOVER] = {
185 {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
186 {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
187 {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
188 {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
189},
190
191/* SuperDuper : https://gist.github.com/narze/861e2167784842d38771
192 * /-----------------------------------------------------------------------------------\
193 * | | | | | | | | | T← | T→ | | |
194 * |------+------+------+------+------+-------------+------+------+------+------+------|
195 * | | Alt | [SuperDuper]| Bksp | Gui | ← | ↓ | ↑ | → | Del | |
196 * |------+------+------+------+------+------|------+------+------+------+------+------|
197 * | | | | | | | | | | | | |
198 * |------+------+------+------+------+-------------+------+------+------+------+------|
199 * | | | | | | Shift | | | | | |
200 * \-----------------------------------------------------------------------------------/
201 */
202[_SUPERDUPER] = {
203 {_______, _______, _______, _______, _______, _______, _______, _______, S(LGUI(KC_LBRC)), S(LGUI(KC_RBRC)), _______, _______},
204 {_______, KC_LALT, _______, _______, KC_BSPC, KC_LGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, _______},
205 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
206 {_______, _______, _______, _______, _______, KC_LSFT, KC_LSFT, _______, _______, _______, _______, _______}
207},
208
209/* Mouse
210 * /-----------------------------------------------------------------------------------\
211 * | | | S↑ | M↑ | S↓ | | | | S↑ | S↓ | | |
212 * |------+------+------+------+------+-------------+------+------+------+------+------|
213 * | | | M← | M↓ | M→ | | M← | M↓ | M↑ | M→ | | |
214 * |------+------+------+------+------+------|------+------+------+------+------+------|
215 * | |[Mouse| | | | M3 | M3 | | | | | |
216 * |------+------+------+------+------+-------------+------+------+------+------+------|
217 * | | | | | M2 | LeftClick | M2 | | | | |
218 * \-----------------------------------------------------------------------------------/
219 */
220[_MOUSE] = {
221 {_______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, _______, KC_WH_U, KC_WH_D, _______, _______},
222 {_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______},
223 {_______, _______, _______, _______, _______, KC_BTN3, KC_BTN3, _______, _______, _______, _______, _______},
224 {_______, _______, _______, _______, KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2, _______, _______, _______, _______}
225},
226
227/* Adjust (Lower + Raise)
228 * ,-----------------------------------------------------------------------------------.
229 * | | Reset| | | | | | | | | | Del |
230 * |------+------+------+------+------+-------------+------+------+------+------+------|
231 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|QwOnCo|Plover| |
232 * |------+------+------+------+------+------|------+------+------+------+------+------|
233 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|SDtogg| | | | |
234 * |------+------+------+------+------+------+------+------+------+------+------+------|
235 * | | | | | | | | | | | |
236 * `-----------------------------------------------------------------------------------'
237 */
238[_ADJUST] = {
239 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
240 {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, QWOC, PLOVER, _______},
241 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, SDTOGG, _______, _______, _______, _______},
242 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
243}
244
245};
246
247#ifdef AUDIO_ENABLE
248 float tone_startup[][2] = SONG(STARTUP_SOUND);
249 float tone_qwerty[][2] = SONG(QWERTY_SOUND);
250 float tone_qwoc[][2] = SONG(DVORAK_SOUND);
251 float tone_colemak[][2] = SONG(COLEMAK_SOUND);
252 float tone_plover[][2] = SONG(PLOVER_SOUND);
253 float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
254 float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
255 float tone_coin[][2] = SONG(COIN_SOUND);
256 float tone_sonic_ring[][2] = SONG(SONIC_RING);
257
258 float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
259 float tone_superduper[][2] = SONG(SUPER_DUPER_SOUND);
260#endif
261
262void persistant_default_layer_set(uint16_t default_layer) {
263 eeconfig_update_default_layer(default_layer);
264 default_layer_set(default_layer);
265}
266
267bool process_record_user(uint16_t keycode, keyrecord_t *record) {
268 switch (keycode) {
269 case QWERTY:
270 if (record->event.pressed) {
271 #ifdef AUDIO_ENABLE
272 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
273 #endif
274 persistant_default_layer_set(1UL<<_QWERTY);
275
276 key_combos[CB_SUPERDUPER].keys = superduper_combos[_QWERTY];
277 eeprom_update_byte(EECONFIG_SUPERDUPER_INDEX, _QWERTY);
278 }
279 return false;
280 break;
281 case COLEMAK:
282 if (record->event.pressed) {
283 #ifdef AUDIO_ENABLE
284 PLAY_NOTE_ARRAY(tone_colemak, false, 0);
285 #endif
286 persistant_default_layer_set(1UL<<_COLEMAK);
287
288 key_combos[CB_SUPERDUPER].keys = superduper_combos[_COLEMAK];
289 eeprom_update_byte(EECONFIG_SUPERDUPER_INDEX, _COLEMAK);
290 }
291 return false;
292 break;
293 case QWOC:
294 if (record->event.pressed) {
295 #ifdef AUDIO_ENABLE
296 PLAY_NOTE_ARRAY(tone_qwoc, false, 0);
297 #endif
298 persistant_default_layer_set(1UL<<_QWOC);
299
300 key_combos[CB_SUPERDUPER].keys = superduper_combos[_QWOC];
301 eeprom_update_byte(EECONFIG_SUPERDUPER_INDEX, _QWOC);
302 }
303 return false;
304 break;
305 case LOWER:
306 if (record->event.pressed) {
307 layer_on(_LOWER);
308 update_tri_layer(_LOWER, _RAISE, _ADJUST);
309 } else {
310 layer_off(_LOWER);
311 update_tri_layer(_LOWER, _RAISE, _ADJUST);
312 }
313 return false;
314 break;
315 case RAISE:
316 if (record->event.pressed) {
317 layer_on(_RAISE);
318 update_tri_layer(_LOWER, _RAISE, _ADJUST);
319 } else {
320 layer_off(_RAISE);
321 update_tri_layer(_LOWER, _RAISE, _ADJUST);
322 }
323 return false;
324 break;
325 case BACKLIT:
326 if (record->event.pressed) {
327 register_code(KC_RSFT);
328 #ifdef BACKLIGHT_ENABLE
329 backlight_step();
330 #endif
331 } else {
332 unregister_code(KC_RSFT);
333 }
334 return false;
335 break;
336 case PLOVER:
337 if (record->event.pressed) {
338 #ifdef AUDIO_ENABLE
339 stop_all_notes();
340 PLAY_NOTE_ARRAY(tone_plover, false, 0);
341 #endif
342 layer_off(_RAISE);
343 layer_off(_LOWER);
344 layer_off(_ADJUST);
345 layer_on(_PLOVER);
346 if (!eeconfig_is_enabled()) {
347 eeconfig_init();
348 }
349 keymap_config.raw = eeconfig_read_keymap();
350 keymap_config.nkro = 1;
351 eeconfig_update_keymap(keymap_config.raw);
352 }
353 return false;
354 break;
355 case EXT_PLV:
356 if (record->event.pressed) {
357 #ifdef AUDIO_ENABLE
358 PLAY_NOTE_ARRAY(tone_plover_gb, false, 0);
359 #endif
360 layer_off(_PLOVER);
361 }
362 return false;
363 break;
364 case SDTOGG:
365 if (record->event.pressed) {
366 superduper_enabled = !superduper_enabled;
367
368 if (superduper_enabled) {
369 set_superduper_key_combos();
370
371 #ifdef AUDIO_ENABLE
372 PLAY_NOTE_ARRAY(tone_sonic_ring, false, 0);
373 #endif
374 } else {
375 clear_superduper_key_combos();
376
377 #ifdef AUDIO_ENABLE
378 PLAY_NOTE_ARRAY(tone_coin, false, 0);
379 #endif
380 }
381 }
382 return false;
383 break;
384 }
385 return true;
386}
387
388void matrix_init_user(void) {
389 #ifdef AUDIO_ENABLE
390 startup_user();
391 #endif
392}
393
394void matrix_setup(void) {
395 set_superduper_key_combos();
396}
397
398void set_superduper_key_combos(void) {
399 uint8_t layer = eeprom_read_byte(EECONFIG_SUPERDUPER_INDEX);
400
401 switch (layer) {
402 case _QWERTY:
403 case _COLEMAK:
404 case _QWOC:
405 key_combos[CB_SUPERDUPER].keys = superduper_combos[layer];
406 break;
407 }
408}
409
410void clear_superduper_key_combos(void) {
411 key_combos[CB_SUPERDUPER].keys = empty_combo;
412}
413
414void matrix_scan_user(void) {
415}
416
417#ifdef AUDIO_ENABLE
418
419void startup_user()
420{
421 _delay_ms(20); // gets rid of tick
422 PLAY_NOTE_ARRAY(tone_startup, false, 0);
423}
424
425void shutdown_user()
426{
427 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
428 _delay_ms(150);
429 stop_all_notes();
430}
431
432void music_on_user(void)
433{
434 music_scale_user();
435}
436
437void music_scale_user(void)
438{
439 PLAY_NOTE_ARRAY(music_scale, false, 0);
440}
441
442#endif
443
444// Combos
445
446void process_combo_event(uint8_t combo_index, bool pressed) {
447 if (pressed) {
448 switch(combo_index) {
449 case CB_SUPERDUPER:
450 layer_on(_SUPERDUPER);
451
452 #ifdef AUDIO_ENABLE
453 PLAY_NOTE_ARRAY(tone_superduper, false, 0);
454 #endif
455 break;
456 }
457 } else {
458 layer_off(_SUPERDUPER);
459 unregister_mods(MOD_BIT(KC_LGUI) | MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); // Sometimes mods are held, unregister them
460 }
461}
462
463// Macros
464
465const uint16_t PROGMEM fn_actions[] = {
466 [M_GUI_UNDS] = ACTION_MACRO_TAP(M_GUI_UNDS),
467 [M_SFT_PO] = ACTION_MACRO_TAP(M_SFT_PO),
468};
469
470const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
471{
472 bool tap_not_interrupted = record->tap.count > 0 && !record->tap.interrupted;
473
474 switch(id) {
475 // Hold for LGUI, tap for Underscore
476 case M_GUI_UNDS:
477 if (record->event.pressed) {
478 m_gui_unds_timer = timer_read();
479
480 if (!tap_not_interrupted) {
481 register_mods(MOD_BIT(KC_LGUI));
482 }
483 } else {
484 if (tap_not_interrupted && timer_elapsed(m_gui_unds_timer) < TAPPING_TERM) {
485 #ifdef AUDIO_ENABLE
486 PLAY_NOTE_ARRAY(tone_superduper, false, 0);
487 #endif
488
489 add_weak_mods(MOD_BIT(KC_LSFT));
490 send_keyboard_report();
491 register_code(KC_MINS);
492 unregister_code(KC_MINS);
493 del_weak_mods(MOD_BIT(KC_LSFT));
494 send_keyboard_report();
495 record->tap.count = 0; // ad hoc: cancel tap
496 } else {
497 unregister_mods(MOD_BIT(KC_LGUI));
498 }
499 }
500 break;
501 // Hold for LSHIFT, tap for Parens open
502 case M_SFT_PO:
503 if (record->event.pressed) {
504 m_sft_po_timer = timer_read();
505
506 if (!tap_not_interrupted) {
507 register_mods(MOD_BIT(KC_LSFT));
508 }
509 } else {
510 if (tap_not_interrupted && timer_elapsed(m_sft_po_timer) < TAPPING_TERM) {
511 #ifdef AUDIO_ENABLE
512 PLAY_NOTE_ARRAY(tone_superduper, false, 0);
513 #endif
514
515 record->tap.count = 0;
516 return MACRO(D(RSFT), T(9), U(RSFT), END);
517 } else {
518 unregister_mods(MOD_BIT(KC_LSFT));
519 }
520 }
521 break;
522 }
523 return MACRO_NONE;
524};
diff --git a/keyboards/planck/keymaps/narze/readme.md b/keyboards/planck/keymaps/narze/readme.md
new file mode 100644
index 000000000..6824251e8
--- /dev/null
+++ b/keyboards/planck/keymaps/narze/readme.md
@@ -0,0 +1,31 @@
1# narze's layout
2
3## Key features
4- Qwerty + [Colemak](https://colemak.com) layouts, and you can type Qwerty on software-level Colemak as well. Very useful for gaming or when your friend wanna type something but don't use Colemak.
5- [(S)uper (D)uper Mode](https://github.com/jasonrudolph/keyboard#super-duper-mode) inspired by [jasonrudolph](https://github.com/jasonrudolph), with [some extensions](https://gist.github.com/narze/861e2167784842d38771) such as backspace & forward delete.
6- Mouse keys with Z
7
8## (S)uper (D)uper Mode
9Press `S+D` simultaneously and hold, then...
10- `H/J/K/L` for Vim-like movement
11- `I/O` to move between browser tabs (Not working on Windows yet)
12- `A` for `Option (Alt)`
13- `F/;` for `Backspace/Forward delete`
14- `A` with `H/L` to move to previous/next word
15- `A` with `G/;` to delete to previous/next word
16- `G` for `Cmd` (Gui/Windows)
17- Available for all layouts (but plover) using physical S & D keys position in qwerty
18- `Spacebar` for `Shift` (it's easier when already holding A with your pinky)
19- Disable with `Raise+Lower+M`
20- You can edit or add more useful keys in SUPERDUPER layer
21- It can be activated by holding `/` as well, but it's slower since `LT()` uses `TAPPING_TERM` of 200ms but `S+D` uses `COMBO_TERM` of only 20ms (Can be changed within config.h)
22
23## Build instructions
24- `cd /path/to/qmk_firmware`
25- `docker run -e keymap=narze -e subproject=rev4 -e keyboard=planck --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware`
26- `dfu-programmer atmega32u4 erase && dfu-programmer atmega32u4 flash .build/planck_rev4_narze.hex`
27
28## TODO
29- [] Make SuperDuper mode fully-compatible in Windows by swapping GUI with Ctrl
30
31
diff --git a/keyboards/planck/keymaps/narze/rules.mk b/keyboards/planck/keymaps/narze/rules.mk
new file mode 100644
index 000000000..05c2ce455
--- /dev/null
+++ b/keyboards/planck/keymaps/narze/rules.mk
@@ -0,0 +1,23 @@
1
2
3# Build Options
4# change to "no" to disable the options, or define them in the Makefile in
5# the appropriate keymap folder that will get included automatically
6#
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = no # Console for debug(+400)
11COMMAND_ENABLE = yes # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
13BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls
15AUDIO_ENABLE = no # Audio output on port C6
16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22
23COMBO_ENABLE = yes