aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIBNobody <ibnobody@gmail.com>2016-09-06 14:57:12 -0500
committerIBNobody <ibnobody@gmail.com>2016-09-06 14:57:12 -0500
commitff53e167670cc760ba0110e632607766dd324412 (patch)
treec10cd73d05201238588e1538c0a5b5f80fda8e69
parentf16fece28330b65253047259a79670289b2bafd5 (diff)
parent8b0769fe5a615e0ed534187de79d09d668737313 (diff)
downloadqmk_firmware-ff53e167670cc760ba0110e632607766dd324412.tar.gz
qmk_firmware-ff53e167670cc760ba0110e632607766dd324412.zip
Merge remote-tracking branch 'refs/remotes/jackhumbert/master'
-rw-r--r--keyboards/ergodox/keymaps/algernon/Makefile9
-rw-r--r--keyboards/ergodox/keymaps/algernon/images/adore-layer.pngbin93748 -> 93893 bytes
-rw-r--r--keyboards/ergodox/keymaps/algernon/images/base-layer.pngbin95222 -> 95204 bytes
-rw-r--r--keyboards/ergodox/keymaps/algernon/keymap.c494
-rw-r--r--keyboards/ergodox/keymaps/algernon/readme.md67
-rw-r--r--keyboards/ergodox/keymaps/algernon/tools/heatmap-layout.ADORE.json (renamed from keyboards/ergodox/keymaps/algernon/tools/heatmap-adore-layout.json)108
-rw-r--r--keyboards/ergodox/keymaps/algernon/tools/heatmap-layout.Dvorak.json (renamed from keyboards/ergodox/keymaps/algernon/tools/heatmap-base-layout.json)29
-rwxr-xr-xkeyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py368
-rw-r--r--keyboards/ergodox/keymaps/coderkun_neo2/Makefile1
-rw-r--r--keyboards/ergodox/keymaps/coderkun_neo2/keymap.c25
-rw-r--r--keyboards/ergodox/keymaps/yoruian/90-ergodox-yoruian.conf6
-rw-r--r--keyboards/ergodox/keymaps/yoruian/Makefile13
-rw-r--r--keyboards/ergodox/keymaps/yoruian/README102
-rw-r--r--keyboards/ergodox/keymaps/yoruian/ergodox_yoruian34
-rw-r--r--keyboards/ergodox/keymaps/yoruian/keymap.c61
-rw-r--r--keyboards/ergodox/keymaps/yoruian/yoruian.h61
-rw-r--r--keyboards/jd40/Makefile74
-rw-r--r--keyboards/jd40/config.h79
-rw-r--r--keyboards/jd40/jd40.c26
-rw-r--r--keyboards/jd40/jd40.h45
-rw-r--r--keyboards/jd40/keymaps/default/keymap.c164
-rw-r--r--keyboards/jd40/readme.md17
-rw-r--r--keyboards/jd40/rules.mk69
-rw-r--r--keyboards/planck/keymaps/callum/keymap.c23
-rw-r--r--keyboards/planck/keymaps/callum/readme.md23
-rw-r--r--keyboards/planck/keymaps/sgoodwin/Makefile25
-rw-r--r--keyboards/planck/keymaps/sgoodwin/keymap.c233
-rw-r--r--keyboards/planck/keymaps/sgoodwin/readme.md10
-rw-r--r--quantum/process_keycode/process_tap_dance.c5
-rw-r--r--tmk_core/rules.mk6
30 files changed, 1624 insertions, 553 deletions
diff --git a/keyboards/ergodox/keymaps/algernon/Makefile b/keyboards/ergodox/keymaps/algernon/Makefile
index 00194857a..7c2b3ad97 100644
--- a/keyboards/ergodox/keymaps/algernon/Makefile
+++ b/keyboards/ergodox/keymaps/algernon/Makefile
@@ -1,22 +1,23 @@
1BOOTMAGIC_ENABLE=no 1BOOTMAGIC_ENABLE=no
2COMMAND_ENABLE=no 2COMMAND_ENABLE=no
3SLEEP_LED_ENABLE=no 3SLEEP_LED_ENABLE=no
4UNICODE_ENABLE=no
5FORCE_NKRO ?= yes 4FORCE_NKRO ?= yes
6DEBUG_ENABLE = no 5DEBUG_ENABLE = no
7CONSOLE_ENABLE = no 6CONSOLE_ENABLE = no
8TAP_DANCE_ENABLE = yes 7TAP_DANCE_ENABLE = yes
9KEYLOGGER_ENABLE ?= yes 8KEYLOGGER_ENABLE ?= yes
9UCIS_ENABLE = yes
10MOUSEKEY_ENABLE ?= yes
10 11
11ADORE_AUTOLOG ?= no 12AUTOLOG_ENABLE ?= no
12 13
13ifeq (${FORCE_NKRO},yes) 14ifeq (${FORCE_NKRO},yes)
14OPT_DEFS += -DFORCE_NKRO 15OPT_DEFS += -DFORCE_NKRO
15endif 16endif
16 17
17ifeq (${ADORE_AUTOLOG},yes) 18ifeq (${AUTOLOG_ENABLE},yes)
18KEYLOGGER_ENABLE = yes 19KEYLOGGER_ENABLE = yes
19OPT_DEFS += -DADORE_AUTOLOG 20OPT_DEFS += -DAUTOLOG_ENABLE
20endif 21endif
21 22
22ifeq (${KEYLOGGER_ENABLE},yes) 23ifeq (${KEYLOGGER_ENABLE},yes)
diff --git a/keyboards/ergodox/keymaps/algernon/images/adore-layer.png b/keyboards/ergodox/keymaps/algernon/images/adore-layer.png
index 44ad8a1eb..3d0a5fb20 100644
--- a/keyboards/ergodox/keymaps/algernon/images/adore-layer.png
+++ b/keyboards/ergodox/keymaps/algernon/images/adore-layer.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/algernon/images/base-layer.png b/keyboards/ergodox/keymaps/algernon/images/base-layer.png
index da159fbe2..7ea57aae3 100644
--- a/keyboards/ergodox/keymaps/algernon/images/base-layer.png
+++ b/keyboards/ergodox/keymaps/algernon/images/base-layer.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/algernon/keymap.c b/keyboards/ergodox/keymaps/algernon/keymap.c
index 144030e2e..9f476d8a6 100644
--- a/keyboards/ergodox/keymaps/algernon/keymap.c
+++ b/keyboards/ergodox/keymaps/algernon/keymap.c
@@ -2,6 +2,7 @@
2 * algernon's ErgoDox EZ layout, please see the readme.md file! 2 * algernon's ErgoDox EZ layout, please see the readme.md file!
3 */ 3 */
4 4
5#include <stdarg.h>
5#include "ergodox.h" 6#include "ergodox.h"
6#include "led.h" 7#include "led.h"
7#include "debug.h" 8#include "debug.h"
@@ -33,7 +34,6 @@ enum {
33 // Buttons that do extra stuff 34 // Buttons that do extra stuff
34 A_GUI, 35 A_GUI,
35 A_PLVR, 36 A_PLVR,
36 A_ESC,
37 A_MPN, 37 A_MPN,
38 38
39 // Function / number keys 39 // Function / number keys
@@ -47,7 +47,6 @@ enum {
47 KF_8, 47 KF_8,
48 KF_9, 48 KF_9,
49 KF_10, 49 KF_10,
50 KF_11, // =, F11
51 50
52 // Application select keys 51 // Application select keys
53 APP_SLK, // Slack 52 APP_SLK, // Slack
@@ -62,6 +61,11 @@ enum {
62 A_MDL, 61 A_MDL,
63 A_MDR, 62 A_MDR,
64 63
64 // Mouse acceleration
65 A_ACL0,
66 A_ACL1,
67 A_ACL2,
68
65 // Hungarian layer keys 69 // Hungarian layer keys
66 HU_AA, // Á 70 HU_AA, // Á
67 HU_OO, // Ó 71 HU_OO, // Ó
@@ -89,7 +93,6 @@ enum {
89 93
90enum { 94enum {
91 CT_CLN = 0, 95 CT_CLN = 0,
92 CT_MNS,
93 CT_TA, 96 CT_TA,
94 CT_LBP, 97 CT_LBP,
95 CT_RBP 98 CT_RBP
@@ -102,7 +105,11 @@ uint16_t gui_timer = 0;
102uint16_t kf_timers[12]; 105uint16_t kf_timers[12];
103 106
104#if KEYLOGGER_ENABLE 107#if KEYLOGGER_ENABLE
108# ifdef AUTOLOG_ENABLE
109bool log_enable = true;
110# else
105bool log_enable = false; 111bool log_enable = false;
112# endif
106#endif 113#endif
107 114
108bool time_travel = false; 115bool time_travel = false;
@@ -114,12 +121,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
114/* Keymap 0: Base Layer 121/* Keymap 0: Base Layer
115 * 122 *
116 * ,-----------------------------------------------------. ,-----------------------------------------------------. 123 * ,-----------------------------------------------------. ,-----------------------------------------------------.
117 * | Next/Prev | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | 124 * | Next/Prev | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | F12 | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 |
118 * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| 125 * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------|
119 * | ~ | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | 126 * | ~ | ' | , | . | P | Y | ( | | ) | F | G | C | R | L | \ |
120 * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| 127 * |-----------+------+------+------+------+------| [ | | ] |------+------+------+------+------+-----------|
121 * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow | 128 * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow |
122 * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| 129 * |-----------+------+------+------+------+------| : | | - |------+------+------+------+------+-----------|
123 * | Play/Pause| / | Q | J | K | X | | | | B | M | W | V | Z | Stop | 130 * | Play/Pause| / | Q | J | K | X | | | | B | M | W | V | Z | Stop |
124 * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' 131 * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------'
125 * | | | | | : | | - | | | | | 132 * | | | | | : | | - | | | | |
@@ -135,21 +142,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
135[BASE] = KEYMAP( 142[BASE] = KEYMAP(
136// left hand 143// left hand
137 M(A_MPN) ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) 144 M(A_MPN) ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR)
138,KC_GRV ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC 145,KC_GRV ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,TD(CT_LBP)
139,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I 146,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I
140,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN 147,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,TD(CT_CLN)
141,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) 148,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN)
142 149
143 ,F(F_ALT),F(F_GUI) 150 ,F(F_ALT),F(F_GUI)
144 ,F(F_CTRL) 151 ,F(F_CTRL)
145 ,KC_BSPC,F(F_SFT),M(A_ESC) 152 ,KC_BSPC,F(F_SFT),KC_ESC
146 153
147 // right hand 154 // right hand
148 ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 155 ,KC_F12 ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11
149 ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS 156 ,TD(CT_RBP),KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS
150 ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL 157 ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL
151 ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP 158 ,KC_MINS ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP
152 ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO 159 ,KC_MINS ,KC_NO ,KC_NO ,KC_NO ,KC_NO
153 160
154 ,OSL(NMDIA),KC_DEL 161 ,OSL(NMDIA),KC_DEL
155 ,KC_LEAD 162 ,KC_LEAD
@@ -159,13 +166,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
159/* Keymap 1: Adore layer 166/* Keymap 1: Adore layer
160 * 167 *
161 * ,-----------------------------------------------------. ,-----------------------------------------------------. 168 * ,-----------------------------------------------------. ,-----------------------------------------------------.
162 * | Play/Pause| 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | 169 * | Play/Pause| 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | F12 | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 |
163 * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| 170 * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------|
164 * | `~ | X | W | K | L | M | ( | | ) | F | H | C | P | Y | \ | 171 * | `~ | Y | W | G | L | M | ( | | ) | F | H | C | P | X | \ |
165 * |-----------+------+------+------+------+------| [ | | ] |------+------+------+------+------+-----------| 172 * |-----------+------+------+------+------+------| [ | | ] |------+------+------+------+------+-----------|
166 * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = | 173 * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = |
167 * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| 174 * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------|
168 * | | Z | Q | ' | , | . | : | | - | B | G | V | J | / | | 175 * | | Z | Q | ' | , | . | : | | - | B | K | V | J | / | |
169 * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' 176 * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------'
170 * | | | | | | | | | | | | 177 * | | | | | | | | | | | |
171 * `-----------------------------------' `-----------------------------------' 178 * `-----------------------------------' `-----------------------------------'
@@ -180,20 +187,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
180[ADORE] = KEYMAP( 187[ADORE] = KEYMAP(
181// left hand 188// left hand
182 KC_MPLY ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) 189 KC_MPLY ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR)
183,KC_GRV ,KC_X ,KC_W ,KC_K ,KC_L ,KC_M ,TD(CT_LBP) 190,KC_GRV ,KC_Y ,KC_W ,KC_G ,KC_L ,KC_M ,TD(CT_LBP)
184,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U 191,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U
185,KC_NO ,KC_Z ,KC_Q ,KC_QUOT,KC_COMM,KC_DOT ,TD(CT_CLN) 192,KC_NO ,KC_Z ,KC_Q ,KC_QUOT,KC_COMM,KC_DOT ,TD(CT_CLN)
186,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO 193,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
187 194
188 ,F(F_ALT),F(F_GUI) 195 ,F(F_ALT),F(F_GUI)
189 ,F(F_CTRL) 196 ,F(F_CTRL)
190 ,KC_BSPC,F(F_SFT),M(A_ESC) 197 ,KC_BSPC,F(F_SFT),KC_ESC
191 198
192 // right hand 199 // right hand
193 ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 200 ,KC_F12 ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11
194 ,TD(CT_RBP),KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS 201 ,TD(CT_RBP),KC_F ,KC_H ,KC_C ,KC_P ,KC_X ,KC_BSLS
195 ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL 202 ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL
196 ,TD(CT_MNS),KC_B ,KC_G ,KC_V ,KC_J ,KC_SLSH ,KC_NO 203 ,KC_MINS ,KC_B ,KC_K ,KC_V ,KC_J ,KC_SLSH ,KC_NO
197 ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO 204 ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
198 205
199 ,OSL(NMDIA),KC_DEL 206 ,OSL(NMDIA),KC_DEL
@@ -363,14 +370,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
363 */ 370 */
364[NMDIA] = KEYMAP( 371[NMDIA] = KEYMAP(
365// left hand 372// left hand
366 KC_ACL0 ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,LGUI(KC_L) 373 M(A_ACL0) ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,LGUI(KC_L)
367,KC_ACL1 ,KC_NO ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_NO 374,M(A_ACL1) ,KC_NO ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_NO
368,KC_ACL2 ,KC_NO ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO 375,M(A_ACL2) ,KC_NO ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO
369,KC_MPLY ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_NO 376,KC_MPLY ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_NO
370,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO 377,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
371 ,KC_MUTE ,KC_VOLU 378 ,KC_MUTE ,KC_VOLU
372 ,KC_VOLD 379 ,KC_VOLD
373 ,KC_SPC,KC_ENTER,M(A_ESC) 380 ,KC_SPC,KC_ENTER,KC_ESC
374 381
375 // right hand 382 // right hand
376 ,LGUI(KC_L),KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO 383 ,LGUI(KC_L),KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO
@@ -439,7 +446,7 @@ const uint16_t PROGMEM fn_actions[] = {
439 ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL) 446 ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL)
440}; 447};
441 448
442void toggle_steno(int pressed) 449static void toggle_steno(int pressed)
443{ 450{
444 uint8_t layer = biton32(layer_state); 451 uint8_t layer = biton32(layer_state);
445 452
@@ -462,7 +469,7 @@ void toggle_steno(int pressed)
462 } 469 }
463} 470}
464 471
465macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char) 472static macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char)
466{ 473{
467 uint8_t need_shift = 0; 474 uint8_t need_shift = 0;
468 uint8_t hold_shift = 0; 475 uint8_t hold_shift = 0;
@@ -507,46 +514,43 @@ macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char)
507 return MACRO_NONE; 514 return MACRO_NONE;
508} 515}
509 516
510void ang_handle_kf (keyrecord_t *record, uint8_t id) 517static bool from_appsel;
518
519static void ang_handle_kf (keyrecord_t *record, uint8_t id)
511{ 520{
512 uint8_t code = id - KF_1; 521 uint8_t code = id - KF_1;
513 522
514 if (record->event.pressed) { 523 if (record->event.pressed) {
515 kf_timers[code] = timer_read (); 524 kf_timers[code] = timer_read ();
516 } else { 525 } else {
517 uint8_t kc; 526 uint8_t kc_base;
518 527
519 if (timer_elapsed (kf_timers[code]) > TAPPING_TERM) { 528 if (from_appsel) {
529 from_appsel = false;
530 return;
531 }
532
533 if (kf_timers[code] && timer_elapsed (kf_timers[code]) > TAPPING_TERM) {
520 // Long press 534 // Long press
521 kc = KC_F1 + code; 535 kc_base = KC_F1;
522 } else { 536 } else {
523 if (id == KF_11) 537 kc_base = KC_1;
524 kc = KC_EQL;
525 else
526 kc = KC_1 + code;
527 } 538 }
539 kf_timers[code] = 0;
540 code += kc_base;
528 541
529 register_code (kc); 542 register_code (code);
530 unregister_code (kc); 543 unregister_code (code);
531 } 544 }
532} 545}
533 546
547static struct {
548 uint8_t idx;
549} m_accel_state;
550
534const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 551const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
535{ 552{
536 switch(id) { 553 switch(id) {
537 case A_ESC:
538 if (record->event.pressed) {
539 if ((get_oneshot_mods ()) && !has_oneshot_mods_timed_out ()) {
540 clear_oneshot_mods ();
541 } else {
542 register_code (KC_ESC);
543 }
544 layer_off (HUN);
545 } else {
546 unregister_code (KC_ESC);
547 }
548 break;
549
550 case A_MPN: 554 case A_MPN:
551 if (record->event.pressed) { 555 if (record->event.pressed) {
552 if (keyboard_report->mods & MOD_BIT(KC_LSFT) || 556 if (keyboard_report->mods & MOD_BIT(KC_LSFT) ||
@@ -588,6 +592,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
588 case HU_UEE: 592 case HU_UEE:
589 return ang_do_hun (record, KC_EQL, KC_U); 593 return ang_do_hun (record, KC_EQL, KC_U);
590 594
595#if MOUSEKEY_ENABLE
591 /* Mouse movement */ 596 /* Mouse movement */
592 case A_MUL: 597 case A_MUL:
593 if (record->event.pressed) { 598 if (record->event.pressed) {
@@ -633,6 +638,24 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
633 mousekey_send(); 638 mousekey_send();
634 break; 639 break;
635 640
641 case A_ACL0 ... A_ACL2:
642 if (record->event.pressed) {
643 uint8_t idx = id - A_ACL0;
644 if (m_accel_state.idx == id) {
645 mousekey_off(m_accel_state.idx - A_ACL0 + KC_ACL0);
646 m_accel_state.idx = 0;
647 } else {
648 if (m_accel_state.idx) {
649 mousekey_off(m_accel_state.idx - A_ACL0 + KC_ACL0);
650 m_accel_state.idx = 0;
651 }
652 mousekey_on(KC_ACL0 + idx);
653 m_accel_state.idx = id;
654 }
655 }
656 break;
657#endif
658
636 /* Plover base */ 659 /* Plover base */
637 case A_PLVR: 660 case A_PLVR:
638 toggle_steno(record->event.pressed); 661 toggle_steno(record->event.pressed);
@@ -663,22 +686,34 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
663 break; 686 break;
664 687
665 case APP_SLK: 688 case APP_SLK:
689 from_appsel = true;
666 return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END); 690 return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END);
667 691
668 case APP_EMCS: 692 case APP_EMCS:
693 from_appsel = true;
669 return MACRODOWN(T(G), T(N), T(U), T(SPC), T(E), T(M), T(A), T(C), T(S), T(SPC), T(2), T(4), T(ENT), END); 694 return MACRODOWN(T(G), T(N), T(U), T(SPC), T(E), T(M), T(A), T(C), T(S), T(SPC), T(2), T(4), T(ENT), END);
670 695
671 case APP_TERM: 696 case APP_TERM:
672 return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END); 697 from_appsel = true;
698 if (!record->event.pressed) {
699 register_code(KC_ESC);
700 unregister_code(KC_ESC);
701 wait_ms(TAPPING_TERM + 25);
702 register_code(KC_DEL);
703 unregister_code(KC_DEL);
704 }
705 break;
673 706
674 case APP_CHRM: 707 case APP_CHRM:
708 from_appsel = true;
675 return MACRODOWN(T(C), T(H), T(R), T(O), T(M), T(ENT), END); 709 return MACRODOWN(T(C), T(H), T(R), T(O), T(M), T(ENT), END);
676 710
677 case APP_MSIC: 711 case APP_MSIC:
712 from_appsel = true;
678 return MACRODOWN(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END); 713 return MACRODOWN(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END);
679 714
680 /* Function keys */ 715 /* Function keys */
681 case KF_1 ... KF_11: 716 case KF_1 ... KF_10:
682 ang_handle_kf (record, id); 717 ang_handle_kf (record, id);
683 break; 718 break;
684 } 719 }
@@ -686,12 +721,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
686 return MACRO_NONE; 721 return MACRO_NONE;
687}; 722};
688 723
689uint8_t is_adore = 0; 724static uint8_t is_adore = 0;
690 725
691// Runs just one time when the keyboard initializes. 726// Runs just one time when the keyboard initializes.
692void matrix_init_user(void) { 727void matrix_init_user(void) {
693 uint8_t dl; 728 uint8_t dl;
694 729
730 set_unicode_input_mode(UC_LNX);
731
695 ergodox_led_all_on(); 732 ergodox_led_all_on();
696 for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { 733 for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) {
697 ergodox_led_all_set (i); 734 ergodox_led_all_set (i);
@@ -709,120 +746,38 @@ void matrix_init_user(void) {
709 dl = eeconfig_read_default_layer (); 746 dl = eeconfig_read_default_layer ();
710 if (dl == (1UL << ADORE)) { 747 if (dl == (1UL << ADORE)) {
711 is_adore = 1; 748 is_adore = 1;
712#if ADORE_AUTOLOG
713 log_enable = true;
714#endif
715 } 749 }
716}; 750};
717 751
718LEADER_EXTERNS(); 752LEADER_EXTERNS();
719 753
720void ang_do_unicode (void) { 754static void ang_tap (uint8_t code, ...) {
721 register_code (KC_RCTL); 755 uint8_t kc = code;
722 register_code (KC_RSFT); 756 va_list ap;
723 register_code (KC_U);
724 unregister_code (KC_U);
725 unregister_code (KC_RSFT);
726 unregister_code (KC_RCTL);
727 wait_ms (100);
728}
729 757
730void ang_tap (uint16_t codes[]) { 758 va_start(ap, code);
731 for (int i = 0; codes[i] != 0; i++) { 759
732 register_code (codes[i]); 760 do {
733 unregister_code (codes[i]); 761 register_code(kc);
734 wait_ms (50); 762 unregister_code(kc);
735 } 763 wait_ms(50);
764 kc = va_arg(ap, int);
765 } while (kc != 0);
766 va_end(ap);
736} 767}
737 768
738#define TAP_ONCE(code) \ 769#define TAP_ONCE(code) \
739 register_code (code); \ 770 register_code (code); \
740 unregister_code (code) 771 unregister_code (code)
741 772
742void ang_tap_dance_bp_finished (qk_tap_dance_state_t *state, void *user_data) {
743 bool left, parens;
744
745 if (state->count > 2) {
746 state->count = 0;
747 return;
748 }
749
750 if (state->keycode == TD(CT_LBP))
751 left = true;
752 else
753 left = false;
754
755 if (state->count == 1)
756 parens = false;
757 else
758 parens = true;
759
760 if (parens) {
761 register_code (KC_RSFT);
762 if (left) {
763 TAP_ONCE(KC_9);
764 } else {
765 TAP_ONCE(KC_0);
766 }
767 unregister_code (KC_RSFT);
768 } else {
769 if (left) {
770 TAP_ONCE (KC_LBRC);
771 } else {
772 TAP_ONCE (KC_RBRC);
773 }
774 }
775}
776
777void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) {
778 if (state->count == 1) {
779 register_code (KC_RSFT);
780 register_code (KC_SCLN);
781 } else if (state->count == 2) {
782 register_code (KC_SCLN);
783 }
784}
785
786void ang_tap_dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) {
787 if (state->count == 1) {
788 unregister_code (KC_SCLN);
789 unregister_code (KC_RSFT);
790 } else if (state->count == 2) {
791 unregister_code (KC_SCLN);
792 }
793}
794
795void ang_tap_dance_mns_finished (qk_tap_dance_state_t *state, void *user_data) {
796 if (state->count == 1) {
797 register_code (KC_MINS);
798 } else if (state->count == 2) {
799 register_code (KC_RSFT);
800 register_code (KC_MINS);
801 }
802}
803
804void ang_tap_dance_mns_reset (qk_tap_dance_state_t *state, void *user_data) {
805 if (state->count == 1) {
806 unregister_code (KC_MINS);
807 } else if (state->count == 2) {
808 unregister_code (KC_RSFT);
809 unregister_code (KC_MINS);
810 }
811}
812
813typedef struct { 773typedef struct {
814 bool layer_toggle; 774 bool layer_toggle;
815 bool sticky; 775 bool sticky;
816 bool finished_once;
817} td_ta_state_t; 776} td_ta_state_t;
818 777
819void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) { 778static void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) {
820 td_ta_state_t *td_ta = (td_ta_state_t *) user_data; 779 td_ta_state_t *td_ta = (td_ta_state_t *) user_data;
821 780
822 if (td_ta->finished_once) {
823 return;
824 }
825
826 if (td_ta->sticky) { 781 if (td_ta->sticky) {
827 td_ta->sticky = false; 782 td_ta->sticky = false;
828 td_ta->layer_toggle = false; 783 td_ta->layer_toggle = false;
@@ -830,7 +785,6 @@ void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) {
830 return; 785 return;
831 } 786 }
832 787
833 td_ta->finished_once = true;
834 if (state->count == 1 && !state->pressed) { 788 if (state->count == 1 && !state->pressed) {
835 register_code (KC_TAB); 789 register_code (KC_TAB);
836 td_ta->sticky = false; 790 td_ta->sticky = false;
@@ -842,35 +796,29 @@ void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) {
842 } 796 }
843} 797}
844 798
845void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) { 799static void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) {
846 td_ta_state_t *td_ta = (td_ta_state_t *) user_data; 800 td_ta_state_t *td_ta = (td_ta_state_t *) user_data;
847 801
848 if (!td_ta->layer_toggle) 802 if (!td_ta->layer_toggle)
849 unregister_code (KC_TAB); 803 unregister_code (KC_TAB);
850 if (!td_ta->sticky) 804 if (!td_ta->sticky)
851 layer_off (ARRW); 805 layer_off (ARRW);
852
853 td_ta->finished_once = false;
854} 806}
855 807
856qk_tap_dance_action_t tap_dance_actions[] = { 808qk_tap_dance_action_t tap_dance_actions[] = {
857 [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) 809 [CT_CLN] = ACTION_TAP_DANCE_DOUBLE (KC_COLN, KC_SCLN)
858 ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset)
859 ,[CT_TA] = { 810 ,[CT_TA] = {
860 .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, 811 .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset },
861 .user_data = (void *)&((td_ta_state_t) { false, false, false }) 812 .user_data = (void *)&((td_ta_state_t) { false, false })
862 } 813 }
863 ,[CT_LBP] = ACTION_TAP_DANCE_FN (ang_tap_dance_bp_finished) 814 ,[CT_LBP] = ACTION_TAP_DANCE_DOUBLE (KC_LBRC, KC_LPRN)
864 ,[CT_RBP] = ACTION_TAP_DANCE_FN (ang_tap_dance_bp_finished) 815 ,[CT_RBP] = ACTION_TAP_DANCE_DOUBLE (KC_RBRC, KC_RPRN)
865}; 816};
866 817
867static uint16_t uni[32];
868static uint8_t unicnt;
869static bool unimagic = false;
870
871// Runs constantly in the background, in a loop. 818// Runs constantly in the background, in a loop.
872void matrix_scan_user(void) { 819void matrix_scan_user(void) {
873 uint8_t layer = biton32(layer_state); 820 uint8_t layer = biton32(layer_state);
821 bool is_arrow = false;
874 822
875 if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) 823 if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM)
876 unregister_code (KC_LGUI); 824 unregister_code (KC_LGUI);
@@ -893,13 +841,19 @@ void matrix_scan_user(void) {
893 ergodox_right_led_2_set (LED_BRIGHTNESS_HI); 841 ergodox_right_led_2_set (LED_BRIGHTNESS_HI);
894 } 842 }
895 843
844 if (layer_state & (1UL << ARRW)) {
845 ergodox_right_led_1_on ();
846 ergodox_right_led_3_on ();
847 is_arrow = true;
848 }
849
896 if (keyboard_report->mods & MOD_BIT(KC_LSFT) || 850 if (keyboard_report->mods & MOD_BIT(KC_LSFT) ||
897 ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { 851 ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) {
898 ergodox_right_led_1_set (LED_BRIGHTNESS_HI); 852 ergodox_right_led_1_set (LED_BRIGHTNESS_HI);
899 ergodox_right_led_1_on (); 853 ergodox_right_led_1_on ();
900 } else { 854 } else {
901 ergodox_right_led_1_set (LED_BRIGHTNESS_LO); 855 ergodox_right_led_1_set (LED_BRIGHTNESS_LO);
902 if (layer != NMDIA && layer != PLVR && layer != ADORE) 856 if (layer != NMDIA && layer != PLVR && layer != ADORE && !is_arrow)
903 ergodox_right_led_1_off (); 857 ergodox_right_led_1_off ();
904 } 858 }
905 859
@@ -919,7 +873,7 @@ void matrix_scan_user(void) {
919 ergodox_right_led_3_on (); 873 ergodox_right_led_3_on ();
920 } else { 874 } else {
921 ergodox_right_led_3_set (LED_BRIGHTNESS_LO); 875 ergodox_right_led_3_set (LED_BRIGHTNESS_LO);
922 if (layer != HUN && layer != PLVR && layer != ADORE) 876 if (layer != HUN && layer != PLVR && layer != ADORE && !is_arrow)
923 ergodox_right_led_3_off (); 877 ergodox_right_led_3_off ();
924 } 878 }
925 879
@@ -936,20 +890,17 @@ void matrix_scan_user(void) {
936 } 890 }
937#endif 891#endif
938 892
893 SEQ_ONE_KEY (KC_Q) {
894 register_code16 (LCTL(KC_1));
895 unregister_code16 (LCTL(KC_1));
896 }
897
939 SEQ_ONE_KEY (KC_T) { 898 SEQ_ONE_KEY (KC_T) {
940 time_travel = !time_travel; 899 time_travel = !time_travel;
941 } 900 }
942 901
943 SEQ_ONE_KEY (KC_U) { 902 SEQ_ONE_KEY (KC_U) {
944 ang_do_unicode (); 903 qk_ucis_start();
945 }
946
947 SEQ_TWO_KEYS (KC_LEAD, KC_U) {
948 unicnt = 0;
949 unimagic = true;
950 register_code(KC_RSFT);
951 TAP_ONCE(KC_U);
952 unregister_code(KC_RSFT);
953 } 904 }
954 905
955 SEQ_ONE_KEY (KC_V) { 906 SEQ_ONE_KEY (KC_V) {
@@ -958,25 +909,23 @@ void matrix_scan_user(void) {
958 909
959 SEQ_ONE_KEY (KC_L) { 910 SEQ_ONE_KEY (KC_L) {
960 /* λ */ 911 /* λ */
961 ang_do_unicode (); 912 unicode_input_start();
962 913 register_hex(0x03bb);
963 uint16_t codes[] = {KC_0, KC_3, KC_B, KC_B, KC_ENT, 0}; 914 unicode_input_finish();
964 ang_tap (codes);
965 } 915 }
966 916
967 SEQ_ONE_KEY (KC_Y) { 917 SEQ_ONE_KEY (KC_Y) {
968 uint16_t codes[] = {KC_BSLS, KC_O, KC_SLSH, 0}; 918 ang_tap (KC_BSLS, KC_O, KC_SLSH, 0);
969 ang_tap (codes);
970 } 919 }
971 920
972 SEQ_ONE_KEY (KC_S) { 921 SEQ_ONE_KEY (KC_S) {
973 ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); 922 unicode_input_start(); register_hex(0xaf); unicode_input_finish();
974 TAP_ONCE (KC_BSLS); 923 TAP_ONCE (KC_BSLS);
975 register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); 924 register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT);
976 ang_do_unicode (); TAP_ONCE (KC_3); TAP_ONCE (KC_0); TAP_ONCE (KC_C); TAP_ONCE (KC_4); TAP_ONCE (KC_SPC); 925 unicode_input_start (); register_hex(0x30c4); unicode_input_finish();
977 register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); 926 register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT);
978 TAP_ONCE (KC_SLSH); 927 TAP_ONCE (KC_SLSH);
979 ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); 928 unicode_input_start (); register_hex(0xaf); unicode_input_finish();
980 } 929 }
981 930
982 SEQ_TWO_KEYS (KC_W, KC_M) { 931 SEQ_TWO_KEYS (KC_W, KC_M) {
@@ -987,8 +936,7 @@ void matrix_scan_user(void) {
987 936
988 wait_ms (1000); 937 wait_ms (1000);
989 938
990 uint16_t codes[] = {KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0}; 939 ang_tap (KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0);
991 ang_tap (codes);
992 register_code (KC_LGUI); 940 register_code (KC_LGUI);
993 register_code (KC_UP); 941 register_code (KC_UP);
994 unregister_code (KC_UP); 942 unregister_code (KC_UP);
@@ -1013,13 +961,7 @@ void matrix_scan_user(void) {
1013 ergodox_right_led_2_off (); 961 ergodox_right_led_2_off ();
1014 wait_ms (100); 962 wait_ms (100);
1015 ergodox_right_led_1_off (); 963 ergodox_right_led_1_off ();
1016#if ADORE_AUTOLOG
1017 log_enable = true;
1018#endif
1019 } else { 964 } else {
1020#if ADORE_AUTOLOG
1021 log_enable = false;
1022#endif
1023 is_adore = 0; 965 is_adore = 0;
1024 default_layer_and (0); 966 default_layer_and (0);
1025 default_layer_or (1UL << BASE); 967 default_layer_or (1UL << BASE);
@@ -1043,140 +985,38 @@ void matrix_scan_user(void) {
1043 985
1044static uint16_t last4[4]; 986static uint16_t last4[4];
1045 987
1046bool is_uni_seq(char *seq) { 988const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE
1047 uint8_t i; 989(
1048 990 UCIS_SYM("poop", 0x1f4a9),
1049 for (i = 0; seq[i]; i++) { 991 UCIS_SYM("rofl", 0x1f923),
1050 uint16_t code; 992 UCIS_SYM("kiss", 0x1f619),
1051 if (('1' <= seq[i]) && (seq[i] <= '9')) 993 UCIS_SYM("snowman", 0x2603),
1052 code = seq[i] - '1' + KC_1; 994 UCIS_SYM("coffee", 0x2615),
1053 else if (seq[i] == '0') 995 UCIS_SYM("heart", 0x2764),
1054 code = KC_0; 996 UCIS_SYM("bolt", 0x26a1)
1055 else 997);
1056 code = seq[i] - 'a' + KC_A;
1057
1058 if (i > unicnt)
1059 return false;
1060 if (uni[i] != code)
1061 return false;
1062 }
1063
1064 if (uni[i] == KC_ENT || uni[i] == KC_SPC)
1065 return true;
1066
1067 return false;
1068}
1069
1070uint16_t hex_to_keycode(uint8_t hex)
1071{
1072 if (hex == 0x0) {
1073 return KC_0;
1074 } else if (hex < 0xA) {
1075 return KC_1 + (hex - 0x1);
1076 } else {
1077 return KC_A + (hex - 0xA);
1078 }
1079}
1080
1081void register_hex(uint16_t hex) {
1082 bool leading_zeros = true;
1083
1084 for(int i = 3; i >= 0; i--) {
1085 uint8_t digit = ((hex >> (i*4)) & 0xF);
1086 if (digit != 0)
1087 leading_zeros = false;
1088 else if (leading_zeros)
1089 continue;
1090 register_code(hex_to_keycode(digit));
1091 unregister_code(hex_to_keycode(digit));
1092 wait_ms(10);
1093 }
1094}
1095
1096typedef struct {
1097 char *symbol;
1098 uint16_t codes[4];
1099} qk_ucis_symbol_t;
1100
1101static qk_ucis_symbol_t ucis_symbol_table[] = {
1102 {"poop", {0x1, 0xf4a9, 0}},
1103 {"rofl", {0x1, 0xf923, 0}},
1104 {"kiss", {0x1, 0xf619, 0}},
1105 {"snowman", {0x2603, 0}},
1106 {NULL, {}}
1107};
1108
1109bool process_record_ucis (uint16_t keycode, keyrecord_t *record) {
1110 uint8_t i;
1111
1112 if (!unimagic)
1113 return true;
1114
1115 if (!record->event.pressed)
1116 return true;
1117
1118 uni[unicnt] = keycode;
1119 unicnt++;
1120
1121 if (keycode == KC_BSPC) {
1122 if (unicnt >= 2) {
1123 unicnt-= 2;
1124 return true;
1125 } else {
1126 unicnt--;
1127 return false;
1128 }
1129 }
1130
1131 if (keycode == KC_ENT || keycode == KC_SPC) {
1132 bool symbol_found = false;
1133
1134 for (i = unicnt; i > 0; i--) {
1135 register_code (KC_BSPC);
1136 unregister_code (KC_BSPC);
1137 wait_ms(10);
1138 }
1139
1140 ang_do_unicode();
1141 wait_ms(10);
1142 for (i = 0; ucis_symbol_table[i].symbol; i++) {
1143 if (is_uni_seq (ucis_symbol_table[i].symbol)) {
1144 symbol_found = true;
1145 for (uint8_t j = 0; ucis_symbol_table[i].codes[j]; j++) {
1146 register_hex(ucis_symbol_table[i].codes[j]);
1147 }
1148 break;
1149 }
1150 }
1151 if (!symbol_found) {
1152 for (i = 0; i < unicnt - 1; i++) {
1153 uint8_t code;
1154
1155 if (uni[i] > KF_1)
1156 code = uni[i] - KF_1 + KC_1;
1157 else
1158 code = uni[i];
1159 TAP_ONCE(code);
1160 wait_ms (10);
1161 }
1162 }
1163
1164 unimagic = false;
1165 return true;
1166 }
1167 return true;
1168}
1169 998
1170bool process_record_user (uint16_t keycode, keyrecord_t *record) { 999bool process_record_user (uint16_t keycode, keyrecord_t *record) {
1171#if KEYLOGGER_ENABLE 1000#if KEYLOGGER_ENABLE
1172 if (log_enable) { 1001 if (log_enable) {
1173 xprintf ("KL: col=%d, row=%d\n", record->event.key.col, 1002 xprintf ("KL: col=%02d, row=%02d, pressed=%d, layer=%s\n", record->event.key.col,
1174 record->event.key.row); 1003 record->event.key.row, record->event.pressed, (is_adore) ? "ADORE" : "Dvorak");
1175 } 1004 }
1176#endif 1005#endif
1177 1006
1178 if (!process_record_ucis (keycode, record)) 1007 if (keycode == KC_ESC && record->event.pressed) {
1179 return false; 1008 bool queue = true;
1009
1010 if ((get_oneshot_mods ()) && !has_oneshot_mods_timed_out ()) {
1011 clear_oneshot_mods ();
1012 queue = false;
1013 }
1014 if (layer_state & (1UL<<HUN)) {
1015 layer_off (HUN);
1016 queue = false;
1017 }
1018 return queue;
1019 }
1180 1020
1181 if (time_travel && !record->event.pressed) { 1021 if (time_travel && !record->event.pressed) {
1182 uint8_t p; 1022 uint8_t p;
@@ -1188,15 +1028,13 @@ bool process_record_user (uint16_t keycode, keyrecord_t *record) {
1188 last4[3] = keycode; 1028 last4[3] = keycode;
1189 1029
1190 if (last4[0] == KC_D && last4[1] == KC_A && last4[2] == KC_T && last4[3] == KC_E) { 1030 if (last4[0] == KC_D && last4[1] == KC_A && last4[2] == KC_T && last4[3] == KC_E) {
1191 uint16_t codes[] = {KC_E, KC_SPC, KC_MINS, KC_D, KC_SPC, KC_QUOT, 0}; 1031 ang_tap (KC_E, KC_SPC, KC_MINS, KC_D, KC_SPC, KC_QUOT, 0);
1192 ang_tap (codes);
1193 register_code (KC_RSFT); 1032 register_code (KC_RSFT);
1194 register_code (KC_EQL); 1033 register_code (KC_EQL);
1195 unregister_code (KC_EQL); 1034 unregister_code (KC_EQL);
1196 unregister_code (KC_RSFT); 1035 unregister_code (KC_RSFT);
1197 1036
1198 uint16_t codes2[] = {KC_4, KC_SPC, KC_D, KC_A, KC_Y, KC_S, KC_QUOT, 0}; 1037 ang_tap (KC_4, KC_SPC, KC_D, KC_A, KC_Y, KC_S, KC_QUOT, 0);
1199 ang_tap (codes2);
1200 1038
1201 return false; 1039 return false;
1202 } 1040 }
@@ -1204,3 +1042,17 @@ bool process_record_user (uint16_t keycode, keyrecord_t *record) {
1204 1042
1205 return true; 1043 return true;
1206} 1044}
1045
1046void qk_ucis_symbol_fallback (void) {
1047 for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) {
1048 uint8_t code;
1049
1050 if (qk_ucis_state.codes[i] > KF_1)
1051 code = qk_ucis_state.codes[i] - KF_1 + KC_1;
1052 else
1053 code = qk_ucis_state.codes[i];
1054 register_code(code);
1055 unregister_code(code);
1056 wait_ms (10);
1057 }
1058}
diff --git a/keyboards/ergodox/keymaps/algernon/readme.md b/keyboards/ergodox/keymaps/algernon/readme.md
index 26dfddbe6..5e7adb332 100644
--- a/keyboards/ergodox/keymaps/algernon/readme.md
+++ b/keyboards/ergodox/keymaps/algernon/readme.md
@@ -3,11 +3,15 @@
3algernon's layout 3algernon's layout
4======================= 4=======================
5 5
6This is an unconventional layout for the ErgoDox EZ. For more details about the history of the layout, see my [blog posts about my ErgoDox journey][blog-ergodox]. 6This is an unconventional layout for the [ErgoDox EZ][ez]. For more details about the history of the layout, see my [blog posts about my ErgoDox journey][blog-ergodox].
7 7
8 [ez]: https://ergodox-ez.com/
8 [blog-ergodox]: https://asylum.madhouse-project.org/blog/tags/ergodox/ 9 [blog-ergodox]: https://asylum.madhouse-project.org/blog/tags/ergodox/
9 10
10Some of the things in the layout only work when one uses Spacemacs and GNOME under Linux. Your mileage may vary. 11Some of the things in the layout only work when one uses [Spacemacs][spacemacs] and [GNOME][gnome] under Linux. Your mileage may vary.
12
13 [spacemacs]: http://spacemacs.org/
14 [gnome]: https://www.gnome.org/
11 15
12## Table of Contents 16## Table of Contents
13 17
@@ -40,10 +44,10 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest
40* The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, which pops up an application selector. It also switches to a one-shot layer, where the number row on the left half turns into app selector macros, for the most common things I usually want to switch to. Otherwise it behaves as on a normal layout. 44* The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, which pops up an application selector. It also switches to a one-shot layer, where the number row on the left half turns into app selector macros, for the most common things I usually want to switch to. Otherwise it behaves as on a normal layout.
41* The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if active. Otherwise it sends the usual keycode. 45* The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if active. Otherwise it sends the usual keycode.
42* The **Media** and **Hun** layer keys are one-shot, the **STENO** key is a toggle. 46* The **Media** and **Hun** layer keys are one-shot, the **STENO** key is a toggle.
43* When holding any of the **Arrow** layer keys, the arrow layer activates while the layer key is held. Tapping the key produces the normal key. 47* When holding the `Tab`/**Arrow** key, the arrow layer activates while the key is held. Tapping the key produces the normal, `Tab` key. Double-tapping it toggles the **Arrow** layer on until a third tap.
44* Tapping the `:` key once yields `:`, tapping it twice yields `;`. 48* Tapping the `:` key once yields `:`, tapping it twice yields `;`.
49* Tapping the `[{(`/`)}]` keys once yields `[` (or `{` when shifted), tapping them twice yields `(`.
45* The **Lead** key allows me to type in a sequence of keys, and trigger some actions: 50* The **Lead** key allows me to type in a sequence of keys, and trigger some actions:
46 - `LEAD u` enters unicode input mode, by sending the GTK+ key sequence that does this.
47 - `LEAD l` uses the unicode input method to enter a `λ`. 51 - `LEAD l` uses the unicode input method to enter a `λ`.
48 - `LEAD s` does a lot of magic to type in a shruggie: `¯\_(ツ)_/¯` 52 - `LEAD s` does a lot of magic to type in a shruggie: `¯\_(ツ)_/¯`
49 - `LEAD y` types `\o/`. 53 - `LEAD y` types `\o/`.
@@ -52,7 +56,7 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest
52 - `LEAD v` prints the firmware version, the keyboard and the keymap. 56 - `LEAD v` prints the firmware version, the keyboard and the keymap.
53 - `LEAD d` toggles logging keypress positions to the HID console. 57 - `LEAD d` toggles logging keypress positions to the HID console.
54 - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader. 58 - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader.
55 - `LEAD LEAD u` enters the [Unicode symbol input][#unicode-symbol-input] mode. 59 - `LEAD u` enters the [Unicode symbol input](#unicode-symbol-input) mode.
56 60
57## ADORE layer 61## ADORE layer
58 62
@@ -91,6 +95,7 @@ For the layers, the following rules apply:
91* When the [ADORE layer](#adore-layer) is toggled on, LEDs will light up from left to right in a sequence, then turn off. When the layer is toggled off, the LEDs light up and turn off in the other direction. No LEDs are on while the layer is active. 95* When the [ADORE layer](#adore-layer) is toggled on, LEDs will light up from left to right in a sequence, then turn off. When the layer is toggled off, the LEDs light up and turn off in the other direction. No LEDs are on while the layer is active.
92* When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* LEDs are on. 96* When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* LEDs are on.
93* When the [Navigation and media layer](#navigation-and-media-layer) is active, the *red* and *green* ones are on. 97* When the [Navigation and media layer](#navigation-and-media-layer) is active, the *red* and *green* ones are on.
98* When the **ARROW** layer is active, the *red* and *blue* ones are on.
94* For the [Steno layer](#steno-layer), all LEDs will be turned on. 99* For the [Steno layer](#steno-layer), all LEDs will be turned on.
95 100
96Unless noted otherwise, the layers use a dim light for the LEDs, while modifiers use a stronger one, and modifiers override any layer preferences. For example, when on the one-handed layer, with the left side active (*red* light blinking), if `Shift` is on, the *red* light will be constantly on. 101Unless noted otherwise, the layers use a dim light for the LEDs, while modifiers use a stronger one, and modifiers override any layer preferences. For example, when on the one-handed layer, with the left side active (*red* light blinking), if `Shift` is on, the *red* light will be constantly on.
@@ -116,7 +121,7 @@ This is an experimental feature, and may or may not work reliably.
116 121
117When the keypress logging functionality is enabled (by `LEAD d`), the keyboard will output a line every time a key is pressed, containing the position of the key in the matrix. This allows one to collect this information, and build analytics over it, such as a heat map, including dead keys too. 122When the keypress logging functionality is enabled (by `LEAD d`), the keyboard will output a line every time a key is pressed, containing the position of the key in the matrix. This allows one to collect this information, and build analytics over it, such as a heat map, including dead keys too.
118 123
119Included with the firmware is a small tool that can parse these logs, and create a heatmap that one can import into [KLE][kle]. To use it, simply point `tools/log-to-heatmap.py` to a base layout file (one is included in the `tools/` directory), and the key position log. The latter one can create by running `hid-listen`, and redirecting its output to a file. 124Included with the firmware is a small tool that can parse these logs, and create a heatmap that one can import into [KLE][kle]. To use it, either pipe the output of `hid_listen` into it, or pipe it an already saved log, and it will save the results into files in an output directory (given on the command-line). See the output of `tools/log-to-heatmap.py --help` for more information.
120 125
121 [kle]: http://www.keyboard-layout-editor.com/ 126 [kle]: http://www.keyboard-layout-editor.com/
122 127
@@ -151,7 +156,35 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the
151 156
152# Changelog 157# Changelog
153 158
154## v1.5 - 2016-08-12 159## v1.6
160
161*2016-08-24*
162
163### Base layer changes
164
165* The parentheses & bracket keys have been merged: tapping them results in `[` or `{` (if it was shifted), double tapping leads to `(`.
166* The `:;` and `-_` keys are now available on the base layer, on their [ADORE](#adore-layer) location, too, just below `[{(`/`]})`.
167* The `Apps` key has been replaced by `F12`.
168* The `-`/`_` is no longer a tap-dance key.
169
170### ADORE layer changes
171
172* Adjustments were made to the [ADORE](#adore-layer) layer, to separate some inconvenient combinations.
173
174### Miscellaneous changes
175
176* `LEAD u` now starts the symbolic unicode input system, instead of the OS-one.
177* The mouse acceleration keys on the [Navigation and Media](#navigation-and-media-layer) layer have been turned into toggles: tap them once to turn them on, until tapped again. Tapping an accelerator button will turn all the others off.
178* When the **ARROW** layer is on, the *red* and *blue* LEDs light up now.
179
180### Heatmap
181
182* The built-in keylogger has been greatly enhanced, it now outputs the pressed state, and the layer (Dvorak or ADORE). As such, the `ADORE_AUTOLOG` option has been removed, instead there is `AUTOLOG_ENABLE` now, which when enabled, makes the keylogger start when the keyboard boots. It defaults to off.
183* The heatmap generator received a lot of updates.
184
185## v1.5
186
187*2016-08-12*
155 188
156* The **1HAND** layer has been removed. 189* The **1HAND** layer has been removed.
157* A `Delete` key is now available on the right thumb cluster. 190* A `Delete` key is now available on the right thumb cluster.
@@ -161,7 +194,9 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the
161* On the **ARROW** layer, `Backspace` has been replaced by `Enter`. 194* On the **ARROW** layer, `Backspace` has been replaced by `Enter`.
162* There is some experimental support for entering Unicode symbols. 195* There is some experimental support for entering Unicode symbols.
163 196
164## v1.4 - 2016-07-29 197## v1.4
198
199*2016-07-29*
165 200
166* When toggling the key logging on or off, the LEDs will do a little dance. 201* When toggling the key logging on or off, the LEDs will do a little dance.
167* The keylogger is now optional, but enabled by default. Use `KEYLOGGER_ENABLE=no` on the `make` command line to disable it. 202* The keylogger is now optional, but enabled by default. Use `KEYLOGGER_ENABLE=no` on the `make` command line to disable it.
@@ -169,14 +204,18 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the
169* The `-`/`_` key was turned into a tap-dance key too. 204* The `-`/`_` key was turned into a tap-dance key too.
170* There is now a way to travel time with the keyboard, toggle the feature on by hitting `LEAD t`. 205* There is now a way to travel time with the keyboard, toggle the feature on by hitting `LEAD t`.
171 206
172## v1.3 - 2016-07-06 207## v1.3
208
209*2016-07-06*
173 210
174* Added support for logging keys, by pressing `LEAD d`. Also included is a tool to generate a [heatmap](#heatmap) out of the logs. 211* Added support for logging keys, by pressing `LEAD d`. Also included is a tool to generate a [heatmap](#heatmap) out of the logs.
175* The arrow and navigation keys were rearranged again, and now require an additional key being held to activate. See the [base layer](#base-layer) for an image that shows where arrows are. 212* The arrow and navigation keys were rearranged again, and now require an additional key being held to activate. See the [base layer](#base-layer) for an image that shows where arrows are.
176* The **experimental** layer has been redone, and is now called [ADORE](#adore-layer), and as such, can be enabled by `LEAD a` now. 213* The **experimental** layer has been redone, and is now called [ADORE](#adore-layer), and as such, can be enabled by `LEAD a` now.
177* Switching between Dvorak and ADORE is now persisted into EEPROM, and survives a reboot. 214* Switching between Dvorak and ADORE is now persisted into EEPROM, and survives a reboot.
178 215
179## v1.2 - 2016-06-22 216## v1.2
217
218*2016-06-22*
180 219
181* The forced NKRO mode can be easily toggled off at compile-time, to make the firmware compatible with [certain operating systems](#using-on-windows). 220* The forced NKRO mode can be easily toggled off at compile-time, to make the firmware compatible with [certain operating systems](#using-on-windows).
182* The `:;` key has changed behaviour: to access the `;` symbol, the key needs to be double-tapped, instead of shifted. 221* The `:;` key has changed behaviour: to access the `;` symbol, the key needs to be double-tapped, instead of shifted.
@@ -187,7 +226,9 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the
187* On the **experimental** layer, the `L` and `Q`, and the `K` and `G` keys were swapped. 226* On the **experimental** layer, the `L` and `Q`, and the `K` and `G` keys were swapped.
188* The [Steno](#steno-layer) layer gained a few more `#` and `*` keys, to make it easier on my fingers. 227* The [Steno](#steno-layer) layer gained a few more `#` and `*` keys, to make it easier on my fingers.
189 228
190## v1.1 - 2016-06-14 229## v1.1
230
231*2016-06-14*
191 232
192* The keyboard starts in NKRO mode, bootmagic and other things are disabled. 233* The keyboard starts in NKRO mode, bootmagic and other things are disabled.
193* A [Steno](#steno-layer) layer was added, to be used with Plover. 234* A [Steno](#steno-layer) layer was added, to be used with Plover.
@@ -201,7 +242,9 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the
201 - `:` now inputs `;` when shifted. 242 - `:` now inputs `;` when shifted.
202* `ESC` cancels the [Hungarian](#hungarian-layer) layer too, not just modifiers. 243* `ESC` cancels the [Hungarian](#hungarian-layer) layer too, not just modifiers.
203 244
204## v1.0 - 2016-05-26 245## v1.0
246
247*2016-05-26*
205 248
206Initial version. 249Initial version.
207 250
diff --git a/keyboards/ergodox/keymaps/algernon/tools/heatmap-adore-layout.json b/keyboards/ergodox/keymaps/algernon/tools/heatmap-layout.ADORE.json
index 544f61ce8..4dfa877a7 100644
--- a/keyboards/ergodox/keymaps/algernon/tools/heatmap-adore-layout.json
+++ b/keyboards/ergodox/keymaps/algernon/tools/heatmap-layout.ADORE.json
@@ -75,9 +75,9 @@
75 "STENO", 75 "STENO",
76 { 76 {
77 "x": 4.5, 77 "x": 4.5,
78 "f": 6 78 "f": 3
79 }, 79 },
80 "<i class='mss mss-Unicode-Option-3'></i>", 80 "F12",
81 { 81 {
82 "c": "#7adabd", 82 "c": "#7adabd",
83 "a": 4, 83 "a": 4,
@@ -94,12 +94,20 @@
94 { 94 {
95 "y": -0.875, 95 "y": -0.875,
96 "c": "#ffb2d2", 96 "c": "#ffb2d2",
97 "f": 3, 97 "f": 9,
98 "a": 6,
98 "w": 1.5 99 "w": 1.5
99 }, 100 },
100 "\n\n~\n`", 101 "\n\n<i class='kb kb-Multimedia-Play-Pause'></i>",
101 { 102 {
102 "t": "#0d0d0b" 103 "t": "#0d0d0b",
104 "f": 3,
105 "a": 4,
106 "fa": [
107 0,
108 0,
109 2
110 ]
103 }, 111 },
104 "!\n1\nF1", 112 "!\n1\nF1",
105 { 113 {
@@ -120,7 +128,7 @@
120 "t": "#000000", 128 "t": "#000000",
121 "a": 6 129 "a": 6
122 }, 130 },
123 "L", 131 "G",
124 { 132 {
125 "x": 10.5 133 "x": 10.5
126 }, 134 },
@@ -132,16 +140,16 @@
132 "x": 2.5, 140 "x": 2.5,
133 "c": "#bfbad1", 141 "c": "#bfbad1",
134 "t": "#0d0d0b", 142 "t": "#0d0d0b",
135 "a": 4 143 "a": 6
136 }, 144 },
137 ">\n.", 145 "W",
138 { 146 {
139 "x": 1, 147 "x": 1,
140 "c": "#7adabd", 148 "c": "#7adabd",
141 "t": "#000000", 149 "t": "#000000",
142 "a": 6 150 "a": 6
143 }, 151 },
144 "W", 152 "L",
145 { 153 {
146 "x": 8.5 154 "x": 8.5
147 }, 155 },
@@ -164,14 +172,15 @@
164 { 172 {
165 "c": "#93c9b7", 173 "c": "#93c9b7",
166 "a": 4, 174 "a": 4,
175 "fa": [0, 0, 0],
167 "h": 1.5 176 "h": 1.5
168 }, 177 },
169 "{\n[", 178 "{\n(\n[",
170 { 179 {
171 "x": 4.5, 180 "x": 4.5,
172 "h": 1.5 181 "h": 1.5
173 }, 182 },
174 "}\n]", 183 "}\n)\n]",
175 { 184 {
176 "c": "#7adabd", 185 "c": "#7adabd",
177 "a": 6 186 "a": 6
@@ -183,21 +192,22 @@
183 "y": -0.875, 192 "y": -0.875,
184 "c": "#ffb07b", 193 "c": "#ffb07b",
185 "t": "#0d0d0b", 194 "t": "#0d0d0b",
186 "f": 6, 195 "f": 3,
196 "a": 4,
187 "w": 1.5 197 "w": 1.5
188 }, 198 },
189 "<i class='fa fa-fast-backward'></i>\n\n<i class='fa fa-fast-forward'></i>", 199 "\n\n~\n`",
190 { 200 {
191 "c": "#ffb2d2", 201 "c": "#ffb2d2",
192 "a": 4, 202 "a": 6,
193 "f": 3 203 "f": 3
194 }, 204 },
195 "<\n,", 205 "Y",
196 { 206 {
197 "x": 14.5, 207 "x": 14.5,
198 "a": 6 208 "a": 6
199 }, 209 },
200 "Y", 210 "X",
201 { 211 {
202 "a": 4, 212 "a": 4,
203 "w": 1.5 213 "w": 1.5
@@ -300,15 +310,14 @@
300 "x": 6.5, 310 "x": 6.5,
301 "c": "#93c9b7", 311 "c": "#93c9b7",
302 "t": "#000000", 312 "t": "#000000",
303 "a": 7,
304 "h": 1.5 313 "h": 1.5
305 }, 314 },
306 "(", 315 ";\n:",
307 { 316 {
308 "x": 4.5, 317 "x": 4.5,
309 "h": 1.5 318 "h": 1.5
310 }, 319 },
311 ")" 320 "_\n-"
312 ], 321 ],
313 [ 322 [
314 { 323 {
@@ -320,7 +329,9 @@
320 }, 329 },
321 "\"\n'", 330 "\"\n'",
322 { 331 {
323 "x": 10.5 332 "x": 10.5,
333 "a": 6,
334 "f": 3
324 }, 335 },
325 "V" 336 "V"
326 ], 337 ],
@@ -329,19 +340,22 @@
329 "y": -0.875, 340 "y": -0.875,
330 "x": 2.5, 341 "x": 2.5,
331 "c": "#bfbad1", 342 "c": "#bfbad1",
332 "t": "#0d0d0b" 343 "t": "#0d0d0b",
344 "a": 6
333 }, 345 },
334 "Z", 346 "Q",
335 { 347 {
336 "x": 1, 348 "x": 1,
337 "c": "#7adabd", 349 "c": "#7adabd",
338 "t": "#000000" 350 "t": "#000000",
351 "a": 4
339 }, 352 },
340 "K", 353 "<\n,",
341 { 354 {
342 "x": 8.5 355 "x": 8.5,
356 "a": 6
343 }, 357 },
344 "G", 358 "K",
345 { 359 {
346 "x": 1, 360 "x": 1,
347 "c": "#bfbad1", 361 "c": "#bfbad1",
@@ -354,11 +368,13 @@
354 "y": -0.875, 368 "y": -0.875,
355 "x": 5.5, 369 "x": 5.5,
356 "c": "#7adabd", 370 "c": "#7adabd",
357 "t": "#000000" 371 "t": "#000000",
372 "a": 4
358 }, 373 },
359 "X", 374 ">\n.",
360 { 375 {
361 "x": 6.5 376 "x": 6.5,
377 "a": 6
362 }, 378 },
363 "B" 379 "B"
364 ], 380 ],
@@ -367,28 +383,32 @@
367 "y": -0.875, 383 "y": -0.875,
368 "c": "#ffb07b", 384 "c": "#ffb07b",
369 "f": 9, 385 "f": 9,
370 "w": 1.5 386 "w": 1.5,
387 "g": true
371 }, 388 },
372 "\n\n<i class='kb kb-Multimedia-Play-Pause'></i>", 389 "",
373 { 390 {
374 "c": "#ffb2d2", 391 "c": "#ffb2d2",
375 "t": "#0d0d0b", 392 "t": "#0d0d0b",
376 "a": 4, 393 "a": 6,
377 "f": 3 394 "f": 3,
395 "g": false
378 }, 396 },
379 "?\n/", 397 "Z",
380 { 398 {
381 "x": 14.5, 399 "x": 14.5,
382 "a": 6 400 "a": 4
383 }, 401 },
384 "Q", 402 "?\n/",
385 { 403 {
386 "c": "#ffb07b", 404 "c": "#ffb07b",
387 "t": "#000000", 405 "t": "#000000",
388 "f": 9, 406 "f": 9,
389 "w": 1.5 407 "g": true,
408 "w": 1.5,
409 "a": 4
390 }, 410 },
391 "<i class='kb kb-Multimedia-Stop'></i>" 411 ""
392 ], 412 ],
393 [ 413 [
394 { 414 {
@@ -414,14 +434,14 @@
414 { 434 {
415 "x": 1, 435 "x": 1,
416 "c": "#d4872a", 436 "c": "#d4872a",
417 "g": false, 437 "g": true,
418 "a": 5 438 "a": 5
419 }, 439 },
420 ";\n:", 440 "",
421 { 441 {
422 "x": 8.5 442 "x": 8.5
423 }, 443 },
424 "_\n-", 444 "",
425 { 445 {
426 "x": 1, 446 "x": 1,
427 "c": "#d9dae0", 447 "c": "#d9dae0",
@@ -503,13 +523,13 @@
503 }, 523 },
504 "MEDIA", 524 "MEDIA",
505 {}, 525 {},
506 "1HAND" 526 "DEL"
507 ], 527 ],
508 [ 528 [
509 { 529 {
510 "x": -3 530 "x": -3
511 }, 531 },
512 "LEAD", 532 "HUN",
513 { 533 {
514 "c": "#d4872a", 534 "c": "#d4872a",
515 "f": 9, 535 "f": 9,
@@ -528,6 +548,6 @@
528 "c": "#f9cd31", 548 "c": "#f9cd31",
529 "f": 2 549 "f": 2
530 }, 550 },
531 "HUN" 551 "LEAD"
532 ] 552 ]
533] 553]
diff --git a/keyboards/ergodox/keymaps/algernon/tools/heatmap-base-layout.json b/keyboards/ergodox/keymaps/algernon/tools/heatmap-layout.Dvorak.json
index 148bb1f23..1248d36af 100644
--- a/keyboards/ergodox/keymaps/algernon/tools/heatmap-base-layout.json
+++ b/keyboards/ergodox/keymaps/algernon/tools/heatmap-layout.Dvorak.json
@@ -75,9 +75,9 @@
75 "STENO", 75 "STENO",
76 { 76 {
77 "x": 4.5, 77 "x": 4.5,
78 "f": 6 78 "f": 3
79 }, 79 },
80 "<i class='mss mss-Unicode-Option-3'></i>", 80 "F12",
81 { 81 {
82 "c": "#7adabd", 82 "c": "#7adabd",
83 "a": 4, 83 "a": 4,
@@ -94,12 +94,21 @@
94 { 94 {
95 "y": -0.875, 95 "y": -0.875,
96 "c": "#ffb2d2", 96 "c": "#ffb2d2",
97 "f": 3, 97 "f": 6,
98 "a": 6,
98 "w": 1.5 99 "w": 1.5
99 }, 100 },
100 "\n\n~\n`", 101 "<i class='fa fa-fast-backward'></i>\n\n<i class='fa fa-fast-forward'></i>",
101 { 102 {
102 "t": "#0d0d0b" 103 "f": 3,
104 "t": "#0d0d0b",
105 "a": 4,
106 "fa": [
107 0,
108 0,
109 2
110 ]
111
103 }, 112 },
104 "!\n1\nF1", 113 "!\n1\nF1",
105 { 114 {
@@ -167,12 +176,12 @@
167 "a": 4, 176 "a": 4,
168 "h": 1.5 177 "h": 1.5
169 }, 178 },
170 "{\n[", 179 "{\n(\n[",
171 { 180 {
172 "x": 4.5, 181 "x": 4.5,
173 "h": 1.5 182 "h": 1.5
174 }, 183 },
175 "}\n]", 184 "}\n)\n]",
176 { 185 {
177 "c": "#7adabd", 186 "c": "#7adabd",
178 "a": 6 187 "a": 6
@@ -184,10 +193,10 @@
184 "y": -0.875, 193 "y": -0.875,
185 "c": "#ffb07b", 194 "c": "#ffb07b",
186 "t": "#0d0d0b", 195 "t": "#0d0d0b",
187 "f": 6, 196 "f": 3,
188 "w": 1.5 197 "w": 1.5
189 }, 198 },
190 "<i class='fa fa-fast-backward'></i>\n\n<i class='fa fa-fast-forward'></i>", 199 "\n\n~\n`",
191 { 200 {
192 "c": "#ffb2d2", 201 "c": "#ffb2d2",
193 "a": 4, 202 "a": 4,
@@ -503,7 +512,7 @@
503 }, 512 },
504 "MEDIA", 513 "MEDIA",
505 {}, 514 {},
506 "1HAND" 515 "DEL"
507 ], 516 ],
508 [ 517 [
509 { 518 {
diff --git a/keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py b/keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py
index a13d12e81..68585843b 100755
--- a/keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py
+++ b/keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py
@@ -3,143 +3,247 @@ import json
3import os 3import os
4import sys 4import sys
5import re 5import re
6import argparse
6 7
7from math import floor 8from math import floor
9from os.path import dirname
10
11class Heatmap(object):
12 coords = [
13 [
14 # Row 0
15 [ 4, 0], [ 4, 2], [ 2, 0], [ 1, 0], [ 2, 2], [ 3, 0], [ 3, 2],
16 [ 3, 4], [ 3, 6], [ 2, 4], [ 1, 2], [ 2, 6], [ 4, 4], [ 4, 6],
17 ],
18 [
19 # Row 1
20 [ 8, 0], [ 8, 2], [ 6, 0], [ 5, 0], [ 6, 2], [ 7, 0], [ 7, 2],
21 [ 7, 4], [ 7, 6], [ 6, 4], [ 5, 2], [ 6, 6], [ 8, 4], [ 8, 6],
22 ],
23 [
24 # Row 2
25 [12, 0], [12, 2], [10, 0], [ 9, 0], [10, 2], [11, 0], [ ],
26 [ ], [11, 2], [10, 4], [ 9, 2], [10, 6], [12, 4], [12, 6],
27 ],
28 [
29 # Row 3
30 [17, 0], [17, 2], [15, 0], [14, 0], [15, 2], [16, 0], [13, 0],
31 [13, 2], [16, 2], [15, 4], [14, 2], [15, 6], [17, 4], [17, 6],
32 ],
33 [
34 # Row 4
35 [20, 0], [20, 2], [19, 0], [18, 0], [19, 2], [], [], [], [],
36 [19, 4], [18, 2], [19, 6], [20, 4], [20, 6],
37 ],
38 [
39 # Row 5
40 [ ], [23, 0], [22, 2], [22, 0], [22, 4], [21, 0], [21, 2],
41 [24, 0], [24, 2], [25, 0], [25, 4], [25, 2], [26, 0], [ ],
42 ],
43 ]
44
45 def set_attr_at(self, block, n, attr, fn, val):
46 blk = self.heatmap[block][n]
47 if attr in blk:
48 blk[attr] = fn(blk[attr], val)
49 else:
50 blk[attr] = fn(None, val)
51
52 def coord(self, col, row):
53 return self.coords[row][col]
54
55 @staticmethod
56 def set_attr(orig, new):
57 return new
58
59 def set_bg(self, (block, n), color):
60 self.set_attr_at(block, n, "c", self.set_attr, color)
61 #self.set_attr_at(block, n, "g", self.set_attr, False)
62
63 def set_tap_info(self, (block, n), count, cap):
64 def _set_tap_info(o, _count, _cap):
65 ns = 4 - o.count ("\n")
66 return o + "\n" * ns + "%.02f%%" % (float(_count) / float(_cap) * 100)
67
68 if not cap:
69 cap = 1
70 self.heatmap[block][n + 1] = _set_tap_info (self.heatmap[block][n + 1], count, cap)
71
72 @staticmethod
73 def heatmap_color (v):
74 colors = [ [0.3, 0.3, 1], [0.3, 1, 0.3], [1, 1, 0.3], [1, 0.3, 0.3]]
75 fb = 0
76 if v <= 0:
77 idx1, idx2 = 0, 0
78 elif v >= 1:
79 idx1, idx2 = len(colors) - 1, len(colors) - 1
80 else:
81 val = v * (len(colors) - 1)
82 idx1 = int(floor(val))
83 idx2 = idx1 + 1
84 fb = val - float(idx1)
85
86 r = (colors[idx2][0] - colors[idx1][0]) * fb + colors[idx1][0]
87 g = (colors[idx2][1] - colors[idx1][1]) * fb + colors[idx1][1]
88 b = (colors[idx2][2] - colors[idx1][2]) * fb + colors[idx1][2]
89
90 r, g, b = [x * 255 for x in r, g, b]
91 return "#%02x%02x%02x" % (r, g, b)
92
93 def __init__(self, layout):
94 self.log = {}
95 self.total = 0
96 self.max_cnt = 0
97 self.layout = layout
98
99 def update_log(self, (c, r)):
100 if not (c, r) in self.log:
101 self.log[(c, r)] = 0
102 self.log[(c, r)] = self.log[(c, r)] + 1
103 self.total = self.total + 1
104 if self.max_cnt < self.log[(c, r)]:
105 self.max_cnt = self.log[(c, r)]
106
107 def get_heatmap(self):
108 with open("%s/heatmap-layout.%s.json" % (dirname(sys.argv[0]), self.layout), "r") as f:
109 self.heatmap = json.load (f)
110
111 ## Reset colors
112 for row in self.coords:
113 for coord in row:
114 if coord != []:
115 self.set_bg (coord, "#d9dae0")
116
117 for (c, r) in self.log:
118 coords = self.coord(c, r)
119 b, n = coords
120 cap = self.max_cnt
121 if cap == 0:
122 cap = 1
123 v = float(self.log[(c, r)]) / cap
124 self.set_bg (coords, self.heatmap_color (v))
125 self.set_tap_info (coords, self.log[(c, r)], self.total)
126 return self.heatmap
127
128 def get_stats(self):
129 usage = [
130 # left hand
131 [0, 0, 0, 0, 0],
132 # right hand
133 [0, 0, 0, 0, 0]
134 ]
135 finger_map = [0, 0, 1, 2, 3, 4, 4]
136 for (c, r) in self.log:
137 if r == 5: # thumb cluster
138 if c <= 6: # left side
139 usage[0][4] = usage[0][4] + self.log[(c, r)]
140 else:
141 usage[1][4] = usage[1][4] + self.log[(c, r)]
142 else:
143 fc = c
144 hand = 0
145 if fc >= 7:
146 fc = fc - 7
147 hand = 1
148 fm = finger_map[fc]
149 usage[hand][fm] = usage[hand][fm] + self.log[(c, r)]
150 hand_usage = [0, 0]
151 for f in usage[0]:
152 hand_usage[0] = hand_usage[0] + f
153 for f in usage[1]:
154 hand_usage[1] = hand_usage[1] + f
155
156 total = self.total
157 if total == 0:
158 total = 1
159 stats = {
160 "hands": {
161 "left": {
162 "usage": float(hand_usage[0]) / total * 100,
163 "fingers": {
164 "0 - pinky": 0,
165 "1 - ring": 0,
166 "2 - middle": 0,
167 "3 - index": 0,
168 "4 - thumb": 0,
169 }
170 },
171 "right": {
172 "usage": float(hand_usage[1]) / total * 100,
173 "fingers": {
174 "0 - thumb": 0,
175 "1 - index": 0,
176 "2 - middle": 0,
177 "3 - ring": 0,
178 "4 - pinky": 0,
179 }
180 },
181 }
182 }
183
184 hmap = ['left', 'right']
185 fmap = ['0 - pinky', '1 - ring', '2 - middle', '3 - index', '4 - thumb',
186 '0 - thumb', '1 - index', '2 - middle', '3 - ring', '4 - pinky']
187 for hand_idx in range(len(usage)):
188 hand = usage[hand_idx]
189 for finger_idx in range(len(hand)):
190 stats['hands'][hmap[hand_idx]]['fingers'][fmap[finger_idx + hand_idx * 5]] = float(hand[finger_idx]) / total * 100
191 return stats
192
193def dump_all(out_dir, heatmaps):
194 for layer in heatmaps.keys():
195 if len(heatmaps[layer].log) == 0:
196 continue
8 197
9cr_coord_map = [ 198 with open ("%s/%s.json" % (out_dir, layer), "w") as f:
10 [ 199 json.dump(heatmaps[layer].get_heatmap(), f)
11 # Row 0 200 print >>sys.stderr, "%s stats:" % (layer)
12 [ 4, 0], [ 4, 2], [ 2, 0], [ 1, 0], [ 2, 2], [ 3, 0], [ 3, 2], 201 json.dump (heatmaps[layer].get_stats(), sys.stderr,
13 [ 3, 4], [ 3, 6], [ 2, 4], [ 1, 2], [ 2, 6], [ 4, 4], [ 4, 6], 202 indent = 4, sort_keys = True)
14 ], 203 print >>sys.stderr, ""
15 [ 204 print >>sys.stderr, ""
16 # Row 1 205
17 [ 8, 0], [ 8, 2], [ 6, 0], [ 5, 0], [ 6, 2], [ 7, 0], [ 7, 2], 206def main(opts):
18 [ 7, 4], [ 7, 6], [ 6, 4], [ 5, 2], [ 6, 6], [ 8, 4], [ 8, 6], 207
19 ], 208 heatmaps = {"Dvorak": Heatmap("Dvorak"),
20 [ 209 "ADORE": Heatmap("ADORE")
21 # Row 2 210 }
22 [12, 0], [12, 2], [10, 0], [ 9, 0], [10, 2], [11, 0], [ ], 211 cnt = 0
23 [ ], [11, 2], [10, 4], [ 9, 2], [10, 6], [12, 4], [12, 6], 212 restrict_row = opts.restrict_row
24 ], 213 out_dir = opts.outdir
25 [ 214
26 # Row 3 215 while True:
27 [17, 0], [17, 2], [15, 0], [14, 0], [15, 2], [16, 0], [13, 0], 216 line = sys.stdin.readline()
28 [13, 2], [16, 2], [15, 4], [14, 2], [15, 6], [17, 4], [17, 6], 217 if not line:
29 ], 218 break
30 [ 219 m = re.search ('KL: col=(\d+), row=(\d+), pressed=(\d+), layer=(.*)', line)
31 # Row 4
32 [20, 0], [20, 2], [19, 0], [18, 0], [19, 2], [], [], [], [],
33 [19, 4], [18, 2], [19, 6], [20, 4], [20, 6],
34 ],
35 [
36 # Row 5
37 [ ], [23, 0], [22, 2], [22, 0], [22, 4], [21, 0], [21, 2],
38 [24, 0], [24, 2], [25, 0], [25, 4], [25, 2], [26, 0], [ ],
39 ],
40]
41
42def set_attr_at(j, b, n, attr, fn, val):
43 blk = j[b][n]
44 if attr in blk:
45 blk[attr] = fn(blk[attr], val)
46 else:
47 blk[attr] = fn(None, val)
48
49def coord(col, row):
50 return cr_coord_map[row][col]
51
52def set_attr(orig, new):
53 return new
54
55def set_bg(j, (b, n), color):
56 set_attr_at(j, b, n, "c", set_attr, color)
57 #set_attr_at(j, b, n, "g", set_attr, False)
58
59def _set_tap_info(o, count, cap):
60 ns = 4 - o.count ("\n")
61 return o + "\n" * ns + "%.02f%%" % (float(count) / float(cap) * 100)
62
63def set_tap_info(j, (b, n), count, cap):
64 j[b][n + 1] = _set_tap_info (j[b][n + 1], count, cap)
65
66def heatmap_color (v):
67 colors = [ [0.3, 0.3, 1], [0.3, 1, 0.3], [1, 1, 0.3], [1, 0.3, 0.3]]
68 fb = 0
69 if v <= 0:
70 idx1, idx2 = 0, 0
71 elif v >= 1:
72 idx1, idx2 = len(colors) - 1, len(colors) - 1
73 else:
74 val = v * (len(colors) - 1)
75 idx1 = int(floor(val))
76 idx2 = idx1 + 1
77 fb = val - float(idx1)
78
79 r = (colors[idx2][0] - colors[idx1][0]) * fb + colors[idx1][0]
80 g = (colors[idx2][1] - colors[idx1][1]) * fb + colors[idx1][1]
81 b = (colors[idx2][2] - colors[idx1][2]) * fb + colors[idx1][2]
82
83 r, g, b = [x * 255 for x in r, g, b]
84 return "#%02x%02x%02x" % (r, g, b)
85
86# Load the keylog
87def load_keylog(fname, restrict_row):
88 keylog = {}
89 total = 0
90 with open(fname, "r") as f:
91 lines = f.readlines()
92 for line in lines:
93 m = re.search ('KL: col=(\d+), row=(\d+)', line)
94 if not m: 220 if not m:
95 continue 221 continue
96 (c, r) = (int(m.group (2)), int(m.group (1))) 222
97 if restrict_row != None and r != int(restrict_row): 223 cnt = cnt + 1
224 (c, r, l) = (int(m.group (2)), int(m.group (1)), m.group (4))
225 if restrict_row != -1 and r != restrict_row:
226 continue
227 if c in opts.ignore_columns:
98 continue 228 continue
99 if (c, r) in keylog:
100 keylog[(c, r)] = keylog[(c, r)] + 1
101 else:
102 keylog[(c, r)] = 1
103 total = total + 1
104 return total / 2, keylog
105
106def l_flat(s):
107 f = s.split("\n")
108 return ", ".join (f)
109
110def main(base_fn, log_fn, restrict_row = None):
111
112 with open(base_fn, "r") as f:
113 layout = json.load (f)
114
115 ## Reset colors
116 for row in cr_coord_map:
117 for col in row:
118 if col != []:
119 set_bg (layout, col, "#d9dae0")
120 #set_attr_at (layout, col[0], col[1], "g", set_attr, True)
121
122 total, log = load_keylog (log_fn, restrict_row)
123 max_cnt = 0
124 for (c, r) in log:
125 max_cnt = max(max_cnt, log[(c, r)])
126
127 # Create the heatmap
128 for (c, r) in log:
129 coords = coord(c, r)
130 b, n = coords
131 cap = max_cnt
132 v = float(log[(c, r)]) / cap
133 print >> sys.stderr, "%s => %d/%d => %f = %s" % (l_flat(layout[b][n+1]), log[(c,r)], cap, v, heatmap_color(v))
134 set_bg (layout, coord(c, r), heatmap_color (v))
135 set_tap_info (layout, coord (c, r), log[(c, r)], total)
136
137 print json.dumps(layout)
138 229
139if __name__ == "__main__": 230 heatmaps[l].update_log ((c, r))
140 if len(sys.argv) < 3: 231
141 print """Log to Heatmap -- creates a heatmap out of keyboard logs 232 if opts.dump_interval != -1 and cnt >= opts.dump_interval:
233 cnt = 0
234 dump_all(out_dir, heatmaps)
142 235
143Usage: log-to-heatmap.py base-layout.json logfile [row] >layout.json""" 236 dump_all (out_dir, heatmaps)
144 sys.exit (1) 237
145 main(*sys.argv[1:]) 238if __name__ == "__main__":
239 parser = argparse.ArgumentParser (description = "keylog to heatmap processor")
240 parser.add_argument ('outdir', action = 'store',
241 help = 'Output directory')
242 parser.add_argument ('--row', dest = 'restrict_row', action = 'store', type = int,
243 default = -1, help = 'Restrict processing to this row only')
244 parser.add_argument ('--dump-interval', dest = 'dump_interval', action = 'store', type = int,
245 default = 100, help = 'Dump stats and heatmap at every Nth event, -1 for dumping at EOF only')
246 parser.add_argument ('--ignore-column', dest = 'ignore_columns', action = 'append', type = int,
247 default = [], help = 'Ignore the specified columns')
248 args = parser.parse_args()
249 main(args)
diff --git a/keyboards/ergodox/keymaps/coderkun_neo2/Makefile b/keyboards/ergodox/keymaps/coderkun_neo2/Makefile
index 6c0a79b11..b0fe90ab1 100644
--- a/keyboards/ergodox/keymaps/coderkun_neo2/Makefile
+++ b/keyboards/ergodox/keymaps/coderkun_neo2/Makefile
@@ -1,2 +1,3 @@
1SLEEP_LED_ENABLE = no 1SLEEP_LED_ENABLE = no
2UNICODE_ENABLE = yes 2UNICODE_ENABLE = yes
3COMMAND_ENABLE = no
diff --git a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c
index 2ac06eef8..0eedecf3d 100644
--- a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c
+++ b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c
@@ -1,5 +1,4 @@
1#include "ergodox.h" 1#include "ergodox.h"
2#include "debug.h"
3#include "action_layer.h" 2#include "action_layer.h"
4#include "led.h" 3#include "led.h"
5#include "keymap_extras/keymap_neo2.h" 4#include "keymap_extras/keymap_neo2.h"
@@ -138,11 +137,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
138 * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐ 137 * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┬─────┬───────┐
139 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ 138 * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
140 * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ 139 * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤
141 * │ │ │ │ │ ✕ │ │ │ │ │ │ F9 │ F10 │ F11 │ F12 │ │ 140 * │ │ ┌ │ ┬ │ ┐ │ ─ │ │ │ │ │ │ │ F9 │ F10 │ F11 │ F12 │ │
142 * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ 141 * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤
143 * │ │ │ │ │ ✓ │ ├─────┤ ├─────┤ │ F5 │ F6 │ F7 │ F8 │ │ 142 * │ │ ├ │ ┼ │ ┤ │ ✓ │ ✕ ├─────┤ ├─────┤ │ F5 │ F6 │ F7 │ F8 │ │
144 * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ 143 * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤
145 * │ │ │ │ │ │ │ │ │ │ │ F1 │ F2 │ F3 │ F4 │ │ 144 * │ │ └ │ ┴ │ ┘ │ │ │ │ │ │ │ F1 │ F2 │ F3 │ F4 │ │
146 * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ 145 * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘
147 * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ 146 * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │
148 * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘ 147 * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┐ ┌─────┬─────┐ └─────┴─────┴─────┴─────┴─────┘
@@ -156,9 +155,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
156[FMU] = KEYMAP( 155[FMU] = KEYMAP(
157 // left hand 156 // left hand
158 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, 157 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
159 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,UC(0x2713),KC_TRNS,KC_TRNS, 158 KC_TRNS, UC(0x250C),UC(0x252C),UC(0x2510),UC(0x2500),UC(0x2502),KC_TRNS,
160 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,UC(0x2715),KC_TRNS, 159 KC_TRNS, UC(0x251C),UC(0x253C),UC(0x2524),UC(0x2713),UC(0x2715),
161 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, 160 KC_TRNS, UC(0x2514),UC(0x2534),UC(0x2518),KC_TRNS,KC_TRNS,KC_TRNS,
162 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, 161 KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
163 KC_MS_L, KC_MS_U, 162 KC_MS_L, KC_MS_U,
164 KC_BTN1, 163 KC_BTN1,
@@ -245,6 +244,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
245 244
246// Runs just one time when the keyboard initializes. 245// Runs just one time when the keyboard initializes.
247void matrix_init_user(void) { 246void matrix_init_user(void) {
247 set_unicode_input_mode(UC_LNX);
248}; 248};
249 249
250 250
@@ -279,3 +279,14 @@ void matrix_scan_user(void)
279 } 279 }
280 280
281}; 281};
282
283
284// Override Unicode start method to use NEO_U instead of KC_U
285void unicode_input_start (void) {
286 register_code(KC_LCTL);
287 register_code(KC_LSFT);
288 register_code(NEO_U);
289 unregister_code(NEO_U);
290 unregister_code(KC_LSFT);
291 unregister_code(KC_LCTL);
292};
diff --git a/keyboards/ergodox/keymaps/yoruian/90-ergodox-yoruian.conf b/keyboards/ergodox/keymaps/yoruian/90-ergodox-yoruian.conf
new file mode 100644
index 000000000..ce4fce3b1
--- /dev/null
+++ b/keyboards/ergodox/keymaps/yoruian/90-ergodox-yoruian.conf
@@ -0,0 +1,6 @@
1Section "InputClass"
2 Identifier "ErgoDox EZ"
3 MatchIsKeyboard "on"
4 MatchProduct "ErgoDox EZ ErgoDox EZ"
5 Option "XkbLayout" "ergodox_yoruian"
6EndSection
diff --git a/keyboards/ergodox/keymaps/yoruian/Makefile b/keyboards/ergodox/keymaps/yoruian/Makefile
new file mode 100644
index 000000000..b43a24c61
--- /dev/null
+++ b/keyboards/ergodox/keymaps/yoruian/Makefile
@@ -0,0 +1,13 @@
1ifndef QUANTUM_DIR
2 include ../../../../Makefile
3endif
4
5install-xorg-configuration:
6 install -m 0664 90-$(KEYBOARD)-$(KEYMAP).conf \
7 /etc/X11/xorg.conf.d/90-$(KEYBOARD)-$(KEYMAP).conf
8 install -m 0644 $(KEYBOARD)_$(KEYMAP) \
9 /usr/share/X11/xkb/symbols/$(KEYBOARD)_$(KEYMAP)
10
11uninstall-xorg-configuration:
12 -rm -f /etc/X11/xorg.conf.d/90-$(KEYBOARD)-$(KEYMAP).conf
13 -rm -f /usr/share/X11/xkb/symbols/$(KEYBOARD)_$(KEYMAP)
diff --git a/keyboards/ergodox/keymaps/yoruian/README b/keyboards/ergodox/keymaps/yoruian/README
new file mode 100644
index 000000000..99b41434e
--- /dev/null
+++ b/keyboards/ergodox/keymaps/yoruian/README
@@ -0,0 +1,102 @@
1 Snarfangel's YORUIAN for the ErgoDox EZ
2 ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
3DEFAULT
4┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓ ┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓
5┃ ` │ ; │ : │ - │ / │ ( │ < ┃ ┃ > │ ) │ ^ │ * │ ~ │ Γ │ σ ┃
6┠───┼───┼───┼───┼───┼───┼───┨ ┠───┼───┼───┼───┼───┼───┼───┨
7┃ ⎋ │ . │ y │ o │ r │ ? │ ✦ ┃ ┃ ✦ │ j │ v │ d │ f │ w │ q ┃
8┠───┼───┼───┼───┼───┼───┤ ┃ ┃ ├───┼───┼───┼───┼───┼───┨
9┃ ⎈ │ u │ i │ a │ n │ ! ├───┨ ┠───┤ m │ h │ t │ s │ c │ ⎈ ┃
10┠───┼───┼───┼───┼───┼───┤ ❖ ┃ ┃ ❖ ├───┼───┼───┼───┼───┼───┨
11┃ λ │ ' │ " │ , │ _ │ = │ ┃ ┃ │ k │ l │ p │ g │ b │ x ┃
12┠───┼───┼───┼───┼───╆━━━┷━━━┛ ┗━━━┷━━━╅───┼───┼───┼───┼───┨
13┃ ⎀ │ E │ │ │ ◆ ┃ ┃ ◆ │ │ │ z │ ⎙ ┃
14┗━━━┷━━━┷━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┷━━━┷━━━┛
15 ┏━━━┯━━━┓ ┏━━━┯━━━┓
16 ┃ ⌫ │ ⌥ ┃ ┃ ⎄ │ ↹ ┃
17 ┏━━━╃───┼───┨ ┠───┼───╄━━━┓
18 ┃ │ │ ┃ ┃ │ │ ┃
19 ┃ e │ ⇧ ├───┨ ┠───┤ ⏎ │ ␣ ┃
20 ┃ │ │ ┃ ┃ │ │ ┃
21 ┗━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┛
22SHIFTED
23┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓ ┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓
24┃ 9 │ 7 │ 5 │ 3 │ 1 │ [ │ { ┃ ┃ } │ ] │ 0 │ 2 │ 4 │ 6 │ 8 ┃
25┠───┼───┼───┼───┼───┼───┼───┨ ┠───┼───┼───┼───┼───┼───┼───┨
26┃ │ * │ Y │ O │ R │ \ │ ┃ ┃ │ J │ V │ D │ F │ W │ Q ┃
27┠───┼───┼───┼───┼───┼───┤ ┃ ┃ ├───┼───┼───┼───┼───┼───┨
28┃ │ U │ I │ A │ N │ | ├───┨ ┠───┤ M │ H │ T │ S │ C │ ┃
29┠───┼───┼───┼───┼───┼───┤ ┃ ┃ ├───┼───┼───┼───┼───┼───┨
30┃ │ # │ $ │ @ │ & │ + │ ┃ ┃ │ K │ L │ P │ G │ B │ X ┃
31┠───┼───┼───┼───┼───╆━━━┷━━━┛ ┗━━━┷━━━╅───┼───┼───┼───┼───┨
32┃ │ │ │ │ ┃ ┃ │ │ │ Z │ ┃
33┗━━━┷━━━┷━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┷━━━┷━━━┛
34 ┏━━━┯━━━┓ ┏━━━┯━━━┓
35 ┃ │ ┃ ┃ │ ┃
36 ┏━━━╃───┼───┨ ┠───┼───╄━━━┓
37 ┃ │ │ ┃ ┃ │ │ ┃
38 ┃ │ ├───┨ ┠───┤ │ ┃
39 ┃ │ │ ┃ ┃ │ │ ┃
40 ┗━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┛
41λ LAYER
42┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓ ┏━━━┯━━━┯━━━┯━━━┯━━━┯━━━┯━━━┓
43┃ │ │ │ │ │ │ ┃ ┃ │ │ ⑤ │ ⑥ │ ⑦ │ ⑧ │ ⑨ ┃
44┠───┼───┼───┼───┼───┼───┼───┨ ┠───┼───┼───┼───┼───┼───┼───┨
45┃ │ │ │ │ │ │ ┃ ┃ │ │ ① │ ② │ ③ │ ④ │ ⑩ ┃
46┠───┼───┼───┼───┼───┼───┤ ┃ ┃ ├───┼───┼───┼───┼───┼───┨
47┃ │ │ │ │ │ ├───┨ ┠───┤ ⎉ │ ← │ ↓ │ ↑ │ → │ ⑪ ┃
48┠───┼───┼───┼───┼───┼───┤ ┃ ┃ ├───┼───┼───┼───┼───┼───┨
49┃ λ │ │ │ │ │ │ ┃ ┃ │ │ ⇱ │ ⎘ │ ⎗ │ ⇲ │ ⑫ ┃
50┠───┼───┼───┼───┼───╆━━━┷━━━┛ ┗━━━┷━━━╅───┼───┼───┼───┼───┨
51┃ │ │ │ │ ┃ ┃ │ │ │ │ ┃
52┗━━━┷━━━┷━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┷━━━┷━━━┛
53 ┏━━━┯━━━┓ ┏━━━┯━━━┓
54 ┃ │ ┃ ┃ │ ┃
55 ┏━━━╃───┼───┨ ┠───┼───╄━━━┓
56 ┃ │ │ ┃ ┃ │ │ ┃
57 ┃ │ ├───┨ ┠───┤ │ ┃
58 ┃ │ │ ┃ ┃ │ │ ┃
59 ┗━━━┷━━━┷━━━┛ ┗━━━┷━━━┷━━━┛
60
61Installation (X only)
62‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
63 1. Build and flash firmware as usual
64
65 2. sudo make install-xorg-configuration
66
67 3. Restart X
68
69Features
70‾‾‾‾‾‾‾‾
71 • E on the thumb
72
73 • Emacs-friendly
74
75 • Symmetric control keys for finger wear levelling
76
77 • Greek and subscript dead keys
78
79 • Compose key for arbitrary Unicode input via ~/.XCompose
80
81Don't Cares
82‾‾‾‾‾‾‾‾‾‾‾
83 • Easy migration from QWERTY
84
85 • Compatbility with non-XKB systems
86
87 • Mouse emulation
88
89 • Media keys
90
91Acknowledgements
92‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
93Snarfangel, for designing the layout.
94
95The GNU FreeFont project and Steve White, for adding new keyboard
96symbols.
97
98Xah Lee, for http://xahlee.info/comp/unicode_computing_symbols.html
99
100Colophon
101‾‾‾‾‾‾‾‾
102This file is best-viewed with an SVN version of GNU FreeFont Mono.
diff --git a/keyboards/ergodox/keymaps/yoruian/ergodox_yoruian b/keyboards/ergodox/keymaps/yoruian/ergodox_yoruian
new file mode 100644
index 000000000..0d13fbfd4
--- /dev/null
+++ b/keyboards/ergodox/keymaps/yoruian/ergodox_yoruian
@@ -0,0 +1,34 @@
1partial alphanumeric_keys modifier_keys
2xkb_symbols "ergodox_yoruian" {
3 include "us"
4 name[Group1]= "English (yoruian-1.0.0)";
5
6 replace key <KP2> { [ Multi_key, Multi_key ] };
7 replace key <KP3> { [ Hyper_L, Hyper_L ] };
8 replace key <AE09> { [ grave, 9 ] };
9 replace key <AE07> { [ semicolon, 7 ] };
10 replace key <AE05> { [ colon, 5 ] };
11 replace key <AE03> { [ minus, 3 ] };
12 replace key <AE01> { [ slash, 1 ] };
13 replace key <AE10> { [ asciicircum, 0 ] };
14 replace key <AE02> { [ percent, 2 ] };
15 replace key <AE04> { [ asciitilde, 4 ] };
16 replace key <AE06> { [ dead_greek, 6 ] };
17 replace key <AE08> { [ dead_caron, 8 ] };
18 replace key <KP1> { [ E, E ] };
19 replace key <AD12> { [ period, asterisk ] };
20 replace key <BKSL> { [ question, backslash ] };
21 replace key <AC10> { [ exclam, bar ] };
22 replace key <AC11> { [ apostrophe, numbersign ] };
23 replace key <AB08> { [ quotedbl, dollar ] };
24 replace key <AB09> { [ comma, at ] };
25 replace key <AB10> { [ underscore, ampersand ] };
26 replace key <KP0> { [ equal, plus ] };
27 replace key <TLDE> { [ parenleft, bracketleft ] };
28 replace key <AE11> { [ less, braceleft ] };
29 replace key <AE12> { [ greater, braceright ] };
30 replace key <AD11> { [ parenright, bracketright ] };
31
32 modifier_map none { <HYPR> };
33 modifier_map Mod3 { <KP3> };
34};
diff --git a/keyboards/ergodox/keymaps/yoruian/keymap.c b/keyboards/ergodox/keymaps/yoruian/keymap.c
new file mode 100644
index 000000000..d3635ddf3
--- /dev/null
+++ b/keyboards/ergodox/keymaps/yoruian/keymap.c
@@ -0,0 +1,61 @@
1/*
2 * Copyright 2016 Thomas Fitzsimmons <fitzsim@fitzsim.org>
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 3 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#include "yoruian.h"
18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20[0] = KEYMAP\
21(9, 7, 5, 3, 1, GRV, MINS, EQL, LBRC, 0, 2, 4, 6, 8,
22 ES, RBRC, Y, O, R, BSLS, P3, P3, J, V, D, F, W, Q,
23 LC, U, I, A, N, SCLN, M, H, T, S, C, RC,
24 FF, QUOT, COMM, DOT, SLSH, P0, LGUI, LGUI, K, L, P, G, B, X,
25 IN, P1, NO, NO, LALT, LALT, NO, NO, Z, PS,
26 BSPC, RALT, P2, TAB,
27 NO, NO,
28 E, LSFT, NO, NO, ENT, SPC),
29[1] = KEYMAP\
30(TR, TR, TR, TR, TR, TR, TR, TR, TR, F5, F6, F7, F8, F9,
31 TR, TR, TR, TR, TR, TR, TR, TR, TR, F1, F2, F3, F4, FT,
32 TR, TR, TR, TR, TR, TR, PAUS, LEFT, DOWN, UP, RGHT, FE,
33 TR, TR, TR, TR, TR, TR, TR, TR, TR, HOME, PGDN, PGUP, END, FW,
34 TR, TR, TR, TR, TR, TR, TR, TR, TR, TR,
35 TR, TR, TR, TR,
36 TR, TR,
37 TR, TR, TR, TR, TR, TR),
38};
39
40const uint16_t PROGMEM fn_actions[] = {
41};
42
43const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
44 return MACRO_NONE;
45};
46
47void matrix_init_user(void) {
48};
49
50void matrix_scan_user(void) {
51 ergodox_board_led_off();
52 ergodox_right_led_1_off();
53 ergodox_right_led_2_off();
54 ergodox_right_led_3_off();
55};
56
57/*
58 * Local Variables:
59 * electric-indent-mode: nil
60 * End:
61 */
diff --git a/keyboards/ergodox/keymaps/yoruian/yoruian.h b/keyboards/ergodox/keymaps/yoruian/yoruian.h
new file mode 100644
index 000000000..1adcb7fd3
--- /dev/null
+++ b/keyboards/ergodox/keymaps/yoruian/yoruian.h
@@ -0,0 +1,61 @@
1/*
2 * Copyright 2016 Thomas Fitzsimmons <fitzsim@fitzsim.org>
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 3 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#include "ergodox.h"
18#include "debug.h"
19#include "action_layer.h"
20
21#undef KEYMAP
22#define KEYMAP\
23( \
24 /* Spacial positions. */ \
25 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \
26 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \
27 k20, k21, k22, k23, k24, k25, k28, k29, k2A, k2B, k2C, k2D, \
28 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \
29 k40, k41, k42, k43, k44, k49, k4A, k4B, k4C, k4D, \
30 k55, k56, k57, k58, \
31 k54, k59, \
32 k53, k52, k51, k5C, k5B, k5A) \
33 \
34 /* Matrix positions. */ \
35 { \
36 { KC_##k00, KC_##k10, KC_##k20, KC_##k30, KC_##k40, KC_NO }, \
37 { KC_##k01, KC_##k11, KC_##k21, KC_##k31, KC_##k41, KC_##k51 }, \
38 { KC_##k02, KC_##k12, KC_##k22, KC_##k32, KC_##k42, KC_##k52 }, \
39 { KC_##k03, KC_##k13, KC_##k23, KC_##k33, KC_##k43, KC_##k53 }, \
40 { KC_##k04, KC_##k14, KC_##k24, KC_##k34, KC_##k44, KC_##k54 }, \
41 { KC_##k05, KC_##k15, KC_##k25, KC_##k35, KC_NO, KC_##k55 }, \
42 { KC_##k06, KC_##k16, KC_NO, KC_##k36, KC_NO, KC_##k56 }, \
43 { KC_##k07, KC_##k17, KC_NO, KC_##k37, KC_NO, KC_##k57 }, \
44 { KC_##k08, KC_##k18, KC_##k28, KC_##k38, KC_NO, KC_##k58 }, \
45 { KC_##k09, KC_##k19, KC_##k29, KC_##k39, KC_##k49, KC_##k59 }, \
46 { KC_##k0A, KC_##k1A, KC_##k2A, KC_##k3A, KC_##k4A, KC_##k5A }, \
47 { KC_##k0B, KC_##k1B, KC_##k2B, KC_##k3B, KC_##k4B, KC_##k5B }, \
48 { KC_##k0C, KC_##k1C, KC_##k2C, KC_##k3C, KC_##k4C, KC_##k5C }, \
49 { KC_##k0D, KC_##k1D, KC_##k2D, KC_##k3D, KC_##k4D, KC_NO } \
50 }
51
52#define KC_ES KC_ESC
53#define KC_LC KC_LCTL
54#define KC_RC KC_RCTL
55#define KC_FF MO(1)
56#define KC_IN KC_INS
57#define KC_PS KC_PSCR
58#define KC_TR KC_TRNS
59#define KC_FT KC_F10
60#define KC_FE KC_F11
61#define KC_FW KC_F12
diff --git a/keyboards/jd40/Makefile b/keyboards/jd40/Makefile
new file mode 100644
index 000000000..242748111
--- /dev/null
+++ b/keyboards/jd40/Makefile
@@ -0,0 +1,74 @@
1
2
3# MCU name
4#MCU = at90usb1287
5MCU = atmega32u4
6
7# Processor frequency.
8# This will define a symbol, F_CPU, in all source code files equal to the
9# processor frequency in Hz. You can then use this symbol in your source code to
10# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
11# automatically to create a 32-bit value in your source code.
12#
13# This will be an integer division of F_USB below, as it is sourced by
14# F_USB after it has run through any CPU prescalers. Note that this value
15# does not *change* the processor frequency - it should merely be updated to
16# reflect the processor speed set externally so that the code can use accurate
17# software delays.
18F_CPU = 16000000
19
20
21#
22# LUFA specific
23#
24# Target architecture (see library "Board Types" documentation).
25ARCH = AVR8
26
27# Input clock frequency.
28# This will define a symbol, F_USB, in all source code files equal to the
29# input clock frequency (before any prescaling is performed) in Hz. This value may
30# differ from F_CPU if prescaling is used on the latter, and is required as the
31# raw input clock is fed directly to the PLL sections of the AVR for high speed
32# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
33# at the end, this will be done automatically to create a 32-bit value in your
34# source code.
35#
36# If no clock division is performed on the input clock inside the AVR (via the
37# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
38F_USB = $(F_CPU)
39
40# Interrupt driven control endpoint task(+60)
41OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
42
43
44# Boot Section Size in *bytes*
45# Teensy halfKay 512
46# Teensy++ halfKay 1024
47# Atmel DFU loader 4096
48# LUFA bootloader 4096
49# USBaspLoader 2048
50OPT_DEFS += -DBOOTLOADER_SIZE=4096
51
52
53# Build Options
54# comment out to disable the options.
55#
56BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
57MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
58EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
59# CONSOLE_ENABLE ?= yes # Console for debug(+400)
60# COMMAND_ENABLE ?= yes # Commands for debug and configuration
61KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
62# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
63# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
64NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
65# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
66# MIDI_ENABLE ?= YES # MIDI controls
67# UNICODE_ENABLE ?= YES # Unicode
68# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
69RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow
70
71ifndef QUANTUM_DIR
72 include ../../Makefile
73endif
74
diff --git a/keyboards/jd40/config.h b/keyboards/jd40/config.h
new file mode 100644
index 000000000..e2594f4b3
--- /dev/null
+++ b/keyboards/jd40/config.h
@@ -0,0 +1,79 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
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#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x6060
26#define DEVICE_VER 0x0001
27#define MANUFACTURER geekhack
28#define PRODUCT jd40v2
29#define DESCRIPTION t.m.k. keyboard firmware for JD40 MKII
30
31/* key matrix size */
32#define MATRIX_ROWS 4
33#define MATRIX_COLS 12
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44*/
45#define MATRIX_ROW_PINS { F0, F1, F5, B4 }
46#define MATRIX_COL_PINS { F4, D7, B5, B6, C6, C7, D4, D6, D5, D0, D1, D2 }
47#define UNUSED_PINS
48
49/* COL2ROW or ROW2COL */
50#define DIODE_DIRECTION COL2ROW
51
52/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
53#define DEBOUNCING_DELAY 5
54
55/* define if matrix has ghost (lacks anti-ghosting diodes) */
56//#define MATRIX_HAS_GHOST
57
58/* number of backlight levels */
59#define BACKLIGHT_LEVELS 3
60
61/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
62#define LOCKING_SUPPORT_ENABLE
63/* Locking resynchronize hack */
64#define LOCKING_RESYNC_ENABLE
65
66
67/* key combination for magic key command */
68#define IS_COMMAND() ( \
69 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
70)
71
72#define RGB_DI_PIN D3
73#define RGBLIGHT_TIMER
74#define RGBLED_NUM 12 // Number of LEDs
75#define RGBLIGHT_HUE_STEP 8
76#define RGBLIGHT_SAT_STEP 8
77#define RGBLIGHT_VAL_STEP 8
78
79#endif
diff --git a/keyboards/jd40/jd40.c b/keyboards/jd40/jd40.c
new file mode 100644
index 000000000..fa06356d9
--- /dev/null
+++ b/keyboards/jd40/jd40.c
@@ -0,0 +1,26 @@
1#include "jd40.h"
2
3void led_set_kb(uint8_t usb_led) {
4 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
5
6
7 // if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
8 // gh60_caps_led_on();
9 // } else {
10 // gh60_caps_led_off();
11 // }
12
13 // if (usb_led & (1<<USB_LED_NUM_LOCK)) {
14 // gh60_esc_led_on();
15 // } else {
16 // gh60_esc_led_off();
17 // }
18
19 // if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
20 // gh60_fn_led_on();
21 // } else {
22 // gh60_fn_led_off();
23 // }
24
25 led_set_user(usb_led);
26}
diff --git a/keyboards/jd40/jd40.h b/keyboards/jd40/jd40.h
new file mode 100644
index 000000000..77a122299
--- /dev/null
+++ b/keyboards/jd40/jd40.h
@@ -0,0 +1,45 @@
1#ifndef JD40_H
2#define JD40_H
3
4#include "quantum.h"
5#include "led.h"
6
7/* GH60 LEDs
8 * GPIO pads
9 * 0 F7 WASD LEDs
10 * 1 F6 ESC LED
11 * 2 F5 FN LED
12 * 3 F4 POKER Arrow LEDs
13 * B2 Capslock LED
14 * B0 not connected
15 */
16
17 /*
18inline void gh60_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); }
19inline void gh60_poker_leds_on(void) { DDRF |= (1<<4); PORTF &= ~(1<<4); }
20inline void gh60_fn_led_on(void) { DDRF |= (1<<5); PORTF &= ~(1<<5); }
21inline void gh60_esc_led_on(void) { DDRF |= (1<<6); PORTF &= ~(1<<6); }
22inline void gh60_wasd_leds_on(void) { DDRF |= (1<<7); PORTF &= ~(1<<7); }
23
24inline void gh60_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
25inline void gh60_poker_leds_off(void) { DDRF &= ~(1<<4); PORTF &= ~(1<<4); }
26inline void gh60_fn_led_off(void) { DDRF &= ~(1<<5); PORTF &= ~(1<<5); }
27inline void gh60_esc_led_off(void) { DDRF &= ~(1<<6); PORTF &= ~(1<<6); }
28inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); }
29*/
30
31/* JD40 MKII keymap definition macro
32 */
33#define KEYMAP( \
34 K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \
35 K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, \
36 K24, K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, \
37 K35, K36, K37, K38, K39, K40, K41, K42, K43, K44 \
38) { \
39 { KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K10, KC_##K11, KC_##K12 }, \
40 { KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_NO }, \
41 { KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_NO }, \
42 { KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_NO, KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_NO } \
43}
44
45#endif
diff --git a/keyboards/jd40/keymaps/default/keymap.c b/keyboards/jd40/keymaps/default/keymap.c
new file mode 100644
index 000000000..79ac146c9
--- /dev/null
+++ b/keyboards/jd40/keymaps/default/keymap.c
@@ -0,0 +1,164 @@
1#include "jd40.h"
2#include "action_layer.h"
3
4#define _BL 0
5#define _AL 1
6#define _FL 2
7#define _UL 3
8
9const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
10 [_BL] = KEYMAP(
11 F12, Q, W, E, R, T, Y, U, I, O, P, BSPC,
12 TAB, A, S, D, F, G, H, J, K, L, ENT,
13 LSFT, Z, X, C, V, B, N, M, COMM, UP, DOT,
14 LCTL, LGUI, LALT, FN0, SPC, SPC, FN0, LEFT, DOWN, RIGHT ),
15
16 [_AL] = KEYMAP(
17 GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, DEL,
18 CAPS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0,
19 TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, SCLN, PGUP, QUOT,
20 TRNS, TRNS, TRNS, TRNS, FN3, FN3, TRNS, HOME, PGDN, END ),
21
22 [_FL] = KEYMAP(
23 TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
24 TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
25 TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
26 TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS ),
27
28 [_UL] = KEYMAP(
29 TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
30 TRNS, FN4, FN5, FN11, FN10, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
31 TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,
32 TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS ),
33};
34
35enum function_id {
36 RGBLED_TOGGLE,
37 RGBLED_STEP_MODE,
38 RGBLED_INCREASE_HUE,
39 RGBLED_DECREASE_HUE,
40 RGBLED_INCREASE_SAT,
41 RGBLED_DECREASE_SAT,
42 RGBLED_INCREASE_VAL,
43 RGBLED_DECREASE_VAL,
44 SHIFT_ESC,
45};
46
47const uint16_t PROGMEM fn_actions[] = {
48 [0] = ACTION_LAYER_MOMENTARY(1), // Momentary Fn overlay
49 [1] = ACTION_LAYER_TOGGLE(2), // Toggle Arrow Layer overlay
50 [2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS), // Tap to toggle caps lock and hold to activate function layer
51 [3] = ACTION_LAYER_TOGGLE(3), // Toggle Underglow Layer overlay
52 [4] = ACTION_FUNCTION(RGBLED_TOGGLE), //Turn on/off underglow
53 [5] = ACTION_FUNCTION(RGBLED_STEP_MODE), // Change underglow mode
54 [6] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
55 [7] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
56 [8] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
57 [9] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
58 [10] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
59 [11] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
60 [12] = ACTION_FUNCTION(SHIFT_ESC),
61};
62
63const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
64{
65 // MACRODOWN only works in this function
66 switch(id) {
67 case 0:
68 if (record->event.pressed) {
69 register_code(KC_RSFT);
70 } else {
71 unregister_code(KC_RSFT);
72 }
73 break;
74 }
75 return MACRO_NONE;
76};
77
78void matrix_scan_user(void) {
79
80// Layer LED indicators
81// ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster
82 uint32_t layer = layer_state;
83 if (layer & (1<<1)) {
84 //gh60_wasd_leds_on();
85 } else {
86 //gh60_wasd_leds_off();
87 }
88
89 if (layer & (1<<2)) {
90 //gh60_esc_led_on();
91 } else {
92 //gh60_esc_led_off();
93 }
94};
95
96#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
97
98void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
99 switch (id) {
100 case RGBLED_TOGGLE:
101 //led operations
102 if (record->event.pressed) {
103 rgblight_toggle();
104 }
105 break;
106 case RGBLED_INCREASE_HUE:
107 if (record->event.pressed) {
108 rgblight_increase_hue();
109 }
110 break;
111 case RGBLED_DECREASE_HUE:
112 if (record->event.pressed) {
113 rgblight_decrease_hue();
114 }
115 break;
116 case RGBLED_INCREASE_SAT:
117 if (record->event.pressed) {
118 rgblight_increase_sat();
119 }
120 break;
121 case RGBLED_DECREASE_SAT:
122 if (record->event.pressed) {
123 rgblight_decrease_sat();
124 }
125 break;
126 case RGBLED_INCREASE_VAL:
127 if (record->event.pressed) {
128 rgblight_increase_val();
129 }
130 break;
131 case RGBLED_DECREASE_VAL:
132 if (record->event.pressed) {
133 rgblight_decrease_val();
134 }
135 break;
136 case RGBLED_STEP_MODE:
137 if (record->event.pressed) {
138 rgblight_step();
139 }
140 break;
141 static uint8_t shift_esc_shift_mask;
142 // Shift + ESC = ~
143 case SHIFT_ESC:
144 shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
145 if (record->event.pressed) {
146 if (shift_esc_shift_mask) {
147 add_key(KC_GRV);
148 send_keyboard_report();
149 } else {
150 add_key(KC_ESC);
151 send_keyboard_report();
152 }
153 } else {
154 if (shift_esc_shift_mask) {
155 del_key(KC_GRV);
156 send_keyboard_report();
157 } else {
158 del_key(KC_ESC);
159 send_keyboard_report();
160 }
161 }
162 break;
163 }
164};
diff --git a/keyboards/jd40/readme.md b/keyboards/jd40/readme.md
new file mode 100644
index 000000000..7daa0980e
--- /dev/null
+++ b/keyboards/jd40/readme.md
@@ -0,0 +1,17 @@
1## jd40 mkii keyboard firmware
2
3 Pins:
4 MATRIX_ROW_PINS { F0, F1, F5, B4 }
5 MATRIX_COL_PINS { F4, D7, B5, B6, C6, C7, D4, D6, D5, D0, D1, D2 }
6 RGB_DI_PIN D3
7
8======================
9
10## Quantum MK Firmware
11
12For the full Quantum feature list, see [the parent readme.md](/readme.md).
13
14## Building
15
16Download or clone the whole firmware and navigate to the keyboards/jd40 folder.
17Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Amtel Flip to program your .hex file.
diff --git a/keyboards/jd40/rules.mk b/keyboards/jd40/rules.mk
new file mode 100644
index 000000000..2f18fdf10
--- /dev/null
+++ b/keyboards/jd40/rules.mk
@@ -0,0 +1,69 @@
1
2
3# MCU name
4#MCU = at90usb1287
5MCU = atmega32u4
6
7# Processor frequency.
8# This will define a symbol, F_CPU, in all source code files equal to the
9# processor frequency in Hz. You can then use this symbol in your source code to
10# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
11# automatically to create a 32-bit value in your source code.
12#
13# This will be an integer division of F_USB below, as it is sourced by
14# F_USB after it has run through any CPU prescalers. Note that this value
15# does not *change* the processor frequency - it should merely be updated to
16# reflect the processor speed set externally so that the code can use accurate
17# software delays.
18F_CPU = 16000000
19
20
21#
22# LUFA specific
23#
24# Target architecture (see library "Board Types" documentation).
25ARCH = AVR8
26
27# Input clock frequency.
28# This will define a symbol, F_USB, in all source code files equal to the
29# input clock frequency (before any prescaling is performed) in Hz. This value may
30# differ from F_CPU if prescaling is used on the latter, and is required as the
31# raw input clock is fed directly to the PLL sections of the AVR for high speed
32# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
33# at the end, this will be done automatically to create a 32-bit value in your
34# source code.
35#
36# If no clock division is performed on the input clock inside the AVR (via the
37# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
38F_USB = $(F_CPU)
39
40# Interrupt driven control endpoint task(+60)
41OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
42
43
44# Boot Section Size in *bytes*
45# Teensy halfKay 512
46# Teensy++ halfKay 1024
47# Atmel DFU loader 4096
48# LUFA bootloader 4096
49# USBaspLoader 2048
50OPT_DEFS += -DBOOTLOADER_SIZE=4096
51
52
53# Build Options
54# comment out to disable the options.
55#
56BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
57MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
58EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
59# CONSOLE_ENABLE ?= yes # Console for debug(+400)
60# COMMAND_ENABLE ?= yes # Commands for debug and configuration
61KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key
62# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
63# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
64NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
65# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
66# MIDI_ENABLE ?= YES # MIDI controls
67# UNICODE_ENABLE ?= YES # Unicode
68# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID
69RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow \ No newline at end of file
diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c
index ed187df1d..6c3431133 100644
--- a/keyboards/planck/keymaps/callum/keymap.c
+++ b/keyboards/planck/keymaps/callum/keymap.c
@@ -20,7 +20,8 @@ enum planck_keycodes {
20 BASE = SAFE_RANGE, 20 BASE = SAFE_RANGE,
21 MOVE, 21 MOVE,
22 SYMB, 22 SYMB,
23 FUNC 23 FUNC,
24 LOCK
24}; 25};
25 26
26// Fillers to make layering more clear 27// Fillers to make layering more clear
@@ -37,14 +38,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
37 * |------+------+------+------+------+------|------+------+------+------+------+------| 38 * |------+------+------+------+------+------|------+------+------+------+------+------|
38 * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | 39 * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift |
39 * |------+------+------+------+------+------+------+------+------+------+------+------| 40 * |------+------+------+------+------+------+------+------+------+------+------+------|
40 * | Func | GUI | Alt | Ctrl | Symb |Enter |Space | Move | GUI | Alt | Ctrl |Caps | 41 * | Func | Ctrl | Alt | GUI | Symb |Enter |Space | Move | GUI | Alt | Ctrl |Caps |
41 * `-----------------------------------------------------------------------------------' 42 * `-----------------------------------------------------------------------------------'
42 */ 43 */
43[_BASE] = { 44[_BASE] = {
44 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, 45 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS},
45 {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, 46 {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
46 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, 47 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
47 {FUNC, KC_LGUI, KC_LALT, KC_LCTL, SYMB, KC_ENT, KC_SPC, MOVE, KC_RGUI, KC_RALT, KC_RCTL, KC_CAPS} 48 {FUNC, KC_LCTL, KC_LALT, KC_LGUI, SYMB, KC_ENT, KC_SPC, MOVE, KC_RGUI, KC_RALT, KC_RCTL, KC_CAPS}
48}, 49},
49 50
50/* MOVE 51/* MOVE
@@ -87,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
87 * ,-----------------------------------------------------------------------------------. 88 * ,-----------------------------------------------------------------------------------.
88 * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | 89 * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
89 * |-----------------------------------------------------------------------------------. 90 * |-----------------------------------------------------------------------------------.
90 * | | Play | Prev | Next | BL+ | | | | | | | | 91 * | | Play | Prev | Next | BL+ | | | Lock | | | | |
91 * |------+------+------+------+------+------|------+------+------+------+------+------| 92 * |------+------+------+------+------+------|------+------+------+------+------+------|
92 * | | Mute | Vol- | Vol+ | BL- | | | | | | | | 93 * | | Mute | Vol- | Vol+ | BL- | | | | | | | |
93 * |------+------+------+------+------+------+------+------+------+------+------+------| 94 * |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -96,7 +97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
96 */ 97 */
97[_FUNC] = { 98[_FUNC] = {
98 {KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 }, 99 {KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 },
99 {_______, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAUS, _______, _______, _______, _______, _______, _______, _______}, 100 {_______, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAUS, _______, _______, LOCK, _______, _______, _______, _______},
100 {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_SLCK, _______, _______, _______, _______, _______, _______, _______}, 101 {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_SLCK, _______, _______, _______, _______, _______, _______, _______},
101 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET } 102 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET }
102} 103}
@@ -133,6 +134,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
133 } 134 }
134 return false; 135 return false;
135 break; 136 break;
137 case LOCK:
138 if (record->event.pressed) {
139 register_code(KC_RSFT);
140 register_code(KC_RCTL);
141 register_code(KC_POWER);
142 } else {
143 unregister_code(KC_POWER);
144 unregister_code(KC_RCTL);
145 unregister_code(KC_RSFT);
146 }
147 return false;
148 break;
136 } 149 }
137 return true; 150 return true;
138} 151}
diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md
index 030def7f7..b70de3f1e 100644
--- a/keyboards/planck/keymaps/callum/readme.md
+++ b/keyboards/planck/keymaps/callum/readme.md
@@ -1,25 +1,20 @@
1# callum’s planck layout 1# callum’s planck layout
2 2
3This is a layout for the grid planck, built with a few ideals in mind. These ideals are just my opinion mind! The great thing about *qmk* is that we can all afford to have different opinions about what makes a good layout: 3This is a layout for the grid planck, built with a few ideals in mind:
4 4
5- Minimal response times should be maintained. i.e. keys that react differently depending on whether they are tapped or held, keys that react differently if they are double tapped, etc. should be avoided --- since they inevitably send their keycode later than a normal key, interrupting the immediate feedback from the screen. Therefore we restrict ourselves to chording. 5- Minimal response times should be maintained. i.e. keys that react differently depending on whether they are tapped or held, keys that react differently if they are double tapped, etc. should be avoided — they inevitably send their keycode later than a normal key, interrupting the immediate feedback from the screen. Therefore we restrict ourselves to chording.
6- The hands should never need to leave the home position. The usual culprit for this is the arrow cluster, so the arrow cluster should be as close to home as possible. 6- The hands should never need to leave the home position. The usual culprit for this is the arrow cluster, so the arrow cluster should be as close to home as possible.
7- There should be two of every modifier (one on each side), since otherwise certain long key combinations become hard to make. 7- There should be two of every modifier (one on each side), otherwise certain long key combinations become hard to make.
8- Backspace should be in the “capslock position” as God intended. 8- Backspace should be in the “capslock position” in the colemak tradition.
9- The keyboard should be usable without any firmware changes on any operating system. In my case that means it should work on *Windows* and *Linux* without any software modifications, while I can change the behaviour slightly on *macOS* in software since that’s my home OS. The images reflect the intended use on *macOS* **after** minor software tweaks; which will be noted.
10 9
11We have four layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow cluster etc, a `SYMB` layer, with numbers and symbols; and a `FUNC` layer, with function keys and media keys. 10We have four layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow cluster etc, a `SYMB` layer, with numbers and symbols; and a `FUNC` layer, with function keys and media keys.
12 11
13## The `BASE` layer 12## The `BASE` layer
14![](http://i.imgur.com/aEXOlWl.png) 13![](http://i.imgur.com/tVNI3SE.png)
15 14
16This is the default layer; in [colemak](https://colemak.com). `esc` and `del` are conspicuously absent but are especially easy to reach from either of the other main layers (see below). The `backspace` location is standard colemak. The `caps` key is still on the `BASE` layer but only because I don’t really use the bottom corners so there’s nothing else I would rather put there. Having `enter` on a thumb means I can still have `quote` immediately to the right of `O`, something that would have annoyed me endlessly otherwise. `minus` is in the upper right because I had an extra space and it’s probably my next most used key that didn’t yet have a home. 15This is the default layer; in [colemak](https://colemak.com). `esc` and `del` are conspicuously absent but are especially easy to reach from either of the other main layers (see below). The `backspace` location is standard colemak. The `caps` key is still on the `BASE` layer but only because I don’t really use the bottom corners so there’s nothing else I would rather put there. Having `enter` on a thumb means I can still have `quote` immediately to the right of `O`, something that would have annoyed me endlessly otherwise. `minus` is in the upper right because I had an extra space and it’s probably my next most used key that didn’t yet have a home.
17 16
18The `MOVE` and `SYMB` layers are reached by holding down the `move` and `symb` keys respectively. The `FUNC` layer is reached by holding down both the `move` and `symb` keys simultaneosly, *or* by holding down the `fn` key. The intended use is that whenever both hands are on the keyboard, the former method is used, and the latter is only used when, for example, reaching over to the keyboard with one hand to access the media controls. 17The `MOVE` and `SYMB` layers are reached by holding down the `move` and `symb` keys respectively. The `FUNC` layer is reached by holding down both the `move` and `symb` keys simultaneously, *or* by holding down the `fn` key. The intended use is that whenever both hands are on the keyboard, the former method is used, and the latter is only used when, for example, reaching over to the keyboard with one hand to access the media controls.
19
20The `ctrl`, `alt`, `cmd` cluster is asymmetric around the centre so that at least one of each of the modifiers can be reached with the thumbs. The intended use is to always hit the left `cmd` and the right `ctrl`, unless an awkward key combination dictates otherwise.
21
22In firmware `ctrl` and `cmd`/`GUI` are swapped with respect to the image above --- I swap them to the illustrated location when using *macOS* and leave them be for *Windows* and *Linux*. (so that `cmd-z,x,c,v,...` becomes `ctrl-z,x,c,v,...` saving me some confusion)
23 18
24## The `MOVE` layer 19## The `MOVE` layer
25![](http://i.imgur.com/KXRSuHT.png) 20![](http://i.imgur.com/KXRSuHT.png)
@@ -40,9 +35,9 @@ The symbol layer has all the numbers and their usual corresponding symbols in th
40Again none of the modifiers are overwritten so that shortcuts involving numbers or symbols work as expected. 35Again none of the modifiers are overwritten so that shortcuts involving numbers or symbols work as expected.
41 36
42## The `FUNC` layer 37## The `FUNC` layer
43![](http://i.imgur.com/skxRZiH.png) 38![](http://i.imgur.com/1VKFBBU.png)
44 39
45The only thing of note here is that `bl+` and `bl-` are short for *backlight up* and *backlight down* respectively, and in firmware are actually `KC_PAUS` and `KC_SLCK` respectively, since *macOS* interprets these as the backlight keys. 40The only things of note here are that `bl+` and `bl-` are short for *backlight up* and *backlight down*, and in firmware are actually `KC_PAUS` and `KC_SLCK` respectively, since *macOS* interprets these as the backlight keys. And that `lock` is currently a macro hard coded to turn off the screen on *macOS*. (By activating the shortcut `shift-ctrl-power`.)
46 41
47## Other changes from the default 42## Other changes from the default
48I have LEDs and sound disabled, simply because I have no need of them. \ No newline at end of file 43I have LEDs and sound disabled, simply because I have no need of them.
diff --git a/keyboards/planck/keymaps/sgoodwin/Makefile b/keyboards/planck/keymaps/sgoodwin/Makefile
new file mode 100644
index 000000000..581e08cd0
--- /dev/null
+++ b/keyboards/planck/keymaps/sgoodwin/Makefile
@@ -0,0 +1,25 @@
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 = yes # 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
23ifndef QUANTUM_DIR
24 include ../../../../Makefile
25endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/sgoodwin/keymap.c b/keyboards/planck/keymaps/sgoodwin/keymap.c
new file mode 100644
index 000000000..4d5d3d7ef
--- /dev/null
+++ b/keyboards/planck/keymaps/sgoodwin/keymap.c
@@ -0,0 +1,233 @@
1// This is sgoodwin's layout file for the Quantum project.
2// It doesn't have Plover or Dvorak layers because he doesn't use that.
3// It Also doesn't allow for swapping alt with CMD because that only happens in error.
4
5#include "planck.h"
6#include "action_layer.h"
7#ifdef AUDIO_ENABLE
8 #include "audio.h"
9#endif
10#include "eeconfig.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#define _QWERTY 1
19#define _COLEMAK 0
20#define _LOWER 3
21#define _RAISE 4
22#define _ADJUST 16
23
24enum planck_keycodes {
25 COLEMAK = SAFE_RANGE,
26 QWERTY,
27 LOWER,
28 RAISE,
29 BACKLIT,
30};
31
32// Fillers to make layering more clear
33#define _______ KC_TRNS
34#define XXXXXXX KC_NO
35
36const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
37
38/* Colemak
39 * ,-----------------------------------------------------------------------------------.
40 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
41 * |------+------+------+------+------+-------------+------+------+------+------+------|
42 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
43 * |------+------+------+------+------+------|------+------+------+------+------+------|
44 * | Shift| Z | X | C | V | B | K | M | , | . | / |SHEnt |
45 * |------+------+------+------+------+------+------+------+------+------+------+------|
46 * | Hyper| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
47 * `-----------------------------------------------------------------------------------'
48 */
49[_COLEMAK] = {
50 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
51 {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
52 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT) },
53 {ALL_T(KC_NO), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
54},
55
56/* Qwerty
57 * ,-----------------------------------------------------------------------------------.
58 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
59 * |------+------+------+------+------+-------------+------+------+------+------+------|
60 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
61 * |------+------+------+------+------+------|------+------+------+------+------+------|
62 * | Shift| Z | X | C | V | B | N | M | , | . | / |SHEnt |
63 * |------+------+------+------+------+------+------+------+------+------+------+------|
64 * | Hyper| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
65 * `-----------------------------------------------------------------------------------'
66 */
67[_QWERTY] = {
68 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
69 {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
70 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT) },
71 {ALL_T(KC_NO), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
72},
73
74/* Lower
75 * ,-----------------------------------------------------------------------------------.
76 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
77 * |------+------+------+------+------+-------------+------+------+------+------+------|
78 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
79 * |------+------+------+------+------+------|------+------+------+------+------+------|
80 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
81 * |------+------+------+------+------+------+------+------+------+------+------+------|
82 * | | | | | | | | Next | Vol- | Vol+ | Play |
83 * `-----------------------------------------------------------------------------------'
84 */
85[_LOWER] = {
86 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
87 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
88 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______},
89 {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
90},
91
92/* Raise
93 * ,-----------------------------------------------------------------------------------.
94 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
95 * |------+------+------+------+------+-------------+------+------+------+------+------|
96 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
97 * |------+------+------+------+------+------|------+------+------+------+------+------|
98 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
99 * |------+------+------+------+------+------+------+------+------+------+------+------|
100 * | | | | | | | | Next | Vol- | Vol+ | Play |
101 * `-----------------------------------------------------------------------------------'
102 */
103[_RAISE] = {
104 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
105 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
106 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______},
107 {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
108},
109
110/* Adjust (Lower + Raise)
111 * ,-----------------------------------------------------------------------------------.
112 * | | Reset| | | | | | | | | | Del |
113 * |------+------+------+------+------+-------------+------+------+------+------+------|
114 * | | | |Aud on|Audoff| | |Qwerty|Colemk| | | |
115 * |------+------+------+------+------+------|------+------+------+------+------+------|
116 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
117 * |------+------+------+------+------+------+------+------+------+------+------+------|
118 * | | | | | | | | | | | |
119 * `-----------------------------------------------------------------------------------'
120 */
121[_ADJUST] = {
122 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
123 {_______, _______, _______, AU_ON, AU_OFF, _______, _______, QWERTY, COLEMAK, _______, _______, _______},
124 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
125 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
126}
127
128
129};
130
131#ifdef AUDIO_ENABLE
132
133float tone_startup[][2] = SONG(STARTUP_SOUND);
134float tone_qwerty[][2] = SONG(QWERTY_SOUND);
135float tone_colemak[][2] = SONG(COLEMAK_SOUND);
136float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
137
138float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
139#endif
140
141
142void persistant_default_layer_set(uint16_t default_layer) {
143 eeconfig_update_default_layer(default_layer);
144 default_layer_set(default_layer);
145}
146
147bool process_record_user(uint16_t keycode, keyrecord_t *record) {
148 switch (keycode) {
149 case QWERTY:
150 if (record->event.pressed) {
151 #ifdef AUDIO_ENABLE
152 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
153 #endif
154 persistant_default_layer_set(1UL<<_QWERTY);
155 }
156 return false;
157 break;
158 case COLEMAK:
159 if (record->event.pressed) {
160 #ifdef AUDIO_ENABLE
161 PLAY_NOTE_ARRAY(tone_colemak, false, 0);
162 #endif
163 persistant_default_layer_set(1UL<<_COLEMAK);
164 }
165 return false;
166 break;
167 case LOWER:
168 if (record->event.pressed) {
169 layer_on(_LOWER);
170 update_tri_layer(_LOWER, _RAISE, _ADJUST);
171 } else {
172 layer_off(_LOWER);
173 update_tri_layer(_LOWER, _RAISE, _ADJUST);
174 }
175 return false;
176 break;
177 case RAISE:
178 if (record->event.pressed) {
179 layer_on(_RAISE);
180 update_tri_layer(_LOWER, _RAISE, _ADJUST);
181 } else {
182 layer_off(_RAISE);
183 update_tri_layer(_LOWER, _RAISE, _ADJUST);
184 }
185 return false;
186 break;
187 case BACKLIT:
188 if (record->event.pressed) {
189 register_code(KC_RSFT);
190 #ifdef BACKLIGHT_ENABLE
191 backlight_step();
192 #endif
193 } else {
194 unregister_code(KC_RSFT);
195 }
196 return false;
197 break;
198 }
199 return true;
200}
201
202void matrix_init_user(void) {
203 #ifdef AUDIO_ENABLE
204 startup_user();
205 #endif
206}
207
208#ifdef AUDIO_ENABLE
209
210void startup_user()
211{
212 _delay_ms(20); // gets rid of tick
213 PLAY_NOTE_ARRAY(tone_startup, false, 0);
214}
215
216void shutdown_user()
217{
218 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
219 _delay_ms(150);
220 stop_all_notes();
221}
222
223void music_on_user(void)
224{
225 music_scale_user();
226}
227
228void music_scale_user(void)
229{
230 PLAY_NOTE_ARRAY(music_scale, false, 0);
231}
232
233#endif
diff --git a/keyboards/planck/keymaps/sgoodwin/readme.md b/keyboards/planck/keymaps/sgoodwin/readme.md
new file mode 100644
index 000000000..dfa88f380
--- /dev/null
+++ b/keyboards/planck/keymaps/sgoodwin/readme.md
@@ -0,0 +1,10 @@
1# sgoodwin's Planck Layout
2
3Includes:
4
51. No Dvorak or Plover
62. No alt-swapping
73. Right enter is shift when held down, enter when tapped.
84. Bottom left corner in normal layers is Hyper and not brightness control.
95. Brightness is instead in the bottom corner on raise/lower.
10
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c
index 07de3ecb8..79ade4d00 100644
--- a/quantum/process_keycode/process_tap_dance.c
+++ b/quantum/process_keycode/process_tap_dance.c
@@ -65,9 +65,9 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
65 highest_td = idx; 65 highest_td = idx;
66 action = &tap_dance_actions[idx]; 66 action = &tap_dance_actions[idx];
67 67
68 action->state.keycode = keycode;
69 action->state.pressed = record->event.pressed; 68 action->state.pressed = record->event.pressed;
70 if (record->event.pressed) { 69 if (record->event.pressed) {
70 action->state.keycode = keycode;
71 action->state.count++; 71 action->state.count++;
72 action->state.timer = timer_read(); 72 action->state.timer = timer_read();
73 73
@@ -77,8 +77,9 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
77 process_tap_dance_action_on_dance_finished (paction); 77 process_tap_dance_action_on_dance_finished (paction);
78 reset_tap_dance (&paction->state); 78 reset_tap_dance (&paction->state);
79 } 79 }
80
81 last_td = keycode;
80 } 82 }
81 last_td = keycode;
82 83
83 break; 84 break;
84 85
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk
index 79fc7119a..e4c8aecb2 100644
--- a/tmk_core/rules.mk
+++ b/tmk_core/rules.mk
@@ -332,11 +332,13 @@ $1/compiler.txt: $1/force
332 $$(CC) --version | cmp -s - $$@ || $$(CC) --version > $$@ 332 $$(CC) --version | cmp -s - $$@ || $$(CC) --version > $$@
333endef 333endef
334 334
335.PRECIOUS: $(MASTER_OUTPUT)/obj.txt
335$(MASTER_OUTPUT)/obj.txt: $(MASTER_OUTPUT)/force 336$(MASTER_OUTPUT)/obj.txt: $(MASTER_OUTPUT)/force
336 echo '$(OBJ)' | cmp -s - $$@ || echo '$(OBJ)' > $$@ 337 echo '$(OBJ)' | cmp -s - $@ || echo '$(OBJ)' > $@
337 338
339.PRECIOUS: $(MASTER_OUTPUT)/ldflags.txt
338$(MASTER_OUTPUT)/ldflags.txt: $(MASTER_OUTPUT)/force 340$(MASTER_OUTPUT)/ldflags.txt: $(MASTER_OUTPUT)/force
339 echo '$(LDFLAGS)' | cmp -s - $$@ || echo '$(LDFLAGS)' > $$@ 341 echo '$(LDFLAGS)' | cmp -s - $@ || echo '$(LDFLAGS)' > $@
340 342
341 343
342# We have to use static rules for the .d files for some reason 344# We have to use static rules for the .d files for some reason