aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/ergodox/keymaps/algernon/keymap.c2
-rw-r--r--keyboards/planck/keymaps/circuit/Makefile25
-rw-r--r--keyboards/planck/keymaps/circuit/Readme.md44
-rw-r--r--keyboards/planck/keymaps/circuit/config.h91
-rw-r--r--keyboards/planck/keymaps/circuit/keyboard-layout.pngbin0 -> 154368 bytes
-rw-r--r--keyboards/planck/keymaps/circuit/keymap.c258
-rw-r--r--keyboards/planck/keymaps/premek/Makefile25
-rw-r--r--keyboards/planck/keymaps/premek/keymap.c231
-rw-r--r--keyboards/planck/keymaps/premek/readme.md4
-rw-r--r--keyboards/preonic/keymaps/kinesis/keymap.c2
-rw-r--r--keyboards/satan/keymaps/iso_split_rshift/.gitignore3
-rw-r--r--keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpgbin0 -> 793980 bytes
-rw-r--r--keyboards/satan/keymaps/iso_split_rshift/Makefile16
-rwxr-xr-xkeyboards/satan/keymaps/iso_split_rshift/build.sh42
-rw-r--r--keyboards/satan/keymaps/iso_split_rshift/config.h27
-rw-r--r--keyboards/satan/keymaps/iso_split_rshift/keymap.c209
-rw-r--r--keyboards/satan/keymaps/iso_split_rshift/readme.md36
-rwxr-xr-xkeyboards/satan/keymaps/iso_split_rshift/resetboard.sh4
-rw-r--r--keyboards/satan/satan.h27
-rw-r--r--quantum/process_keycode/process_tap_dance.c122
-rw-r--r--quantum/process_keycode/process_tap_dance.h9
-rw-r--r--readme.md4
22 files changed, 1113 insertions, 68 deletions
diff --git a/keyboards/ergodox/keymaps/algernon/keymap.c b/keyboards/ergodox/keymaps/algernon/keymap.c
index 244bfb51f..144030e2e 100644
--- a/keyboards/ergodox/keymaps/algernon/keymap.c
+++ b/keyboards/ergodox/keymaps/algernon/keymap.c
@@ -853,7 +853,7 @@ void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) {
853 td_ta->finished_once = false; 853 td_ta->finished_once = false;
854} 854}
855 855
856const qk_tap_dance_action_t tap_dance_actions[] = { 856qk_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) 857 [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset)
858 ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) 858 ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset)
859 ,[CT_TA] = { 859 ,[CT_TA] = {
diff --git a/keyboards/planck/keymaps/circuit/Makefile b/keyboards/planck/keymaps/circuit/Makefile
new file mode 100644
index 000000000..1ed0ff956
--- /dev/null
+++ b/keyboards/planck/keymaps/circuit/Makefile
@@ -0,0 +1,25 @@
1
2# Build Options
3# change to "no" to disable the options, or define them in the makefile.mk in
4# the appropriate keymap folder that will get included automatically
5#
6BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
7MOUSEKEY_ENABLE = no # Mouse keys(+4700)
8EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
9CONSOLE_ENABLE = no # Console for debug(+400)
10COMMAND_ENABLE = yes # Commands for debug and configuration
11NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
12BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
13MIDI_ENABLE = no # MIDI controls
14AUDIO_ENABLE = no # Audio output on port C6
15UNICODE_ENABLE = no # Unicode
16BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
17RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
18TAP_DANCE_ENABLE = yes # Enables the double-tap functionality of keys
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
diff --git a/keyboards/planck/keymaps/circuit/Readme.md b/keyboards/planck/keymaps/circuit/Readme.md
new file mode 100644
index 000000000..cbdf5de4e
--- /dev/null
+++ b/keyboards/planck/keymaps/circuit/Readme.md
@@ -0,0 +1,44 @@
1##Design goals:
21. Arrow keys always available.
32. As close to a to my US layout 107-key QWERTY keyboard as I could manage, (i.e. as few arbitrary decisions as possible).
43. Togglable DVORAK keyboard.
54. most frequently used things in the easiest to reach places.
65. Ability to game on it, just for fun.
7
8My layout differs from most in the placement the ARROW keys, `ESC`, VOL keys, use of double-tap `CAPS`, and the GAME LOCK function.
9
10I put the layer buttons in the usual spots. I originally wanted only function/symbols layer, but that proved detrimental. I use some timed press actions to save some space, but this has been accounted for, (see GAME LOCK below). I'm not fully satisfied with the current product (see NOTES below), so it may change in the future.
11
12##Effective layers:
13* Default later is obviously your letters and modifiers.
14* Lower layer [NUMBER] is your numbers and punctuation.
15* Upper layer [ACTION] is your symbols and actions.
16* Function layer is the infrequently used function keys, layout toggle, game lock, and reset.
17
18There is also a toggle for the DVORAK/QWERTY layers, but in normal typing this is not of concern.
19
20###Special keys:
21* `RSHFT` and `ENTER` are combined. Tap once for `ENTER` and hold for `RSHFT`. `ENTER` will be registered on release if released within 200 ms, else `RSHFT` is registered starting at 201 ms until release.
22* If for some reason, this interferes with the normal usage of the `ENTER` key in any way, (some problem that may never happen), I have added a regular non-modified `ENTER` key on the same key in the [ACTION] layer.
23* `LSHFT` and `CAPS` are also combined. The key works like a normal `LSHFT` unless double-tapped, in which case it counts as `CAPS`. This functionality unfortunately delays all key presses by at most 200 ms, but I have added ways to disable this both temporarily or permanently, described below.
24* A failsafe `CAPS` key is on the same key in the [ACTION] layer.
25* There are `UNDO`, `CUT`, `COPY`, and `PASTE` keys. This was intended to be a universal way to use these commands since in macOS cut is `⌘ + C` but in Windows it is `⌃ + C`. Unfortunately these special keys only work in Windows. ¯\\\_(ツ)\_/¯
26
27##Game lock:
28**TL;DR** the game lock toggle disables the double-tap `CAPS`, and disables `GUI` keys (WINDOWS key).
29
30I wished for this keyboard to be fully usable in the most demanding of games. The most demanding game I know of is ARMA 3 which has a binding to practically every individual key of a 107-key keyboard. This means I need to have pretty much every key possible somewhere. I also wanted the keyboard to be responsive in games for every critical keypress. This means having a way to disable features that introduce an inherent delay to registering keys, such as double-tap.
31
32I do not expect to see this used by the pros, but I enjoyed making it. As for use in ARMA 3, I got a little ways into the APEX campaign, but I found a few flaws. For Example, I cannot enable my HUD GPS since that requires `RCTRL`+`M` but `RCTRL` is not bound. The obvious fix is to rebind the action to a new key, but I still take this as a shortcoming of my layout.
33
34###If you wish to disable double-tap
35####Disable it temporarily
36Turn on the game lock. While on, it registers as normal `LSHFT` and has no delay. Whether in game mode or not, `CAPS` is on the same key in the [ACTION] layer.
37
38####Disable it permanently
39Open the `Makefile` and set `TAP_DANCE_ENABLE = no`. I wrote the layout to compensate for this change, and no further changes to the code should be necessary. Whether or not it's disabled, `CAPS` is on the same key in the [ACTION] layer.
40
41##Notes:
42* `ALT` and `GUI` are reversed compared to the normal US layout. I will also be using my Planck on my mac, and that's the standard in the Apple ecosystem. I may add a special compiler flag in the future to swap the two.
43* The DVORAK `Z` key is to the right of the `S` key instead of under it as part of a compromise I made to keep the ARROW keys available on the default layer. I prioritize the ARROW keys, so the DVORAK layout is the one to suffer.
44* I also support the little tones that the default Planck layout features, identical to them too, (minus those for layouts I don't support). To enable it, open the `Makefile` and set `AUDIO_ENABLE = yes`.
diff --git a/keyboards/planck/keymaps/circuit/config.h b/keyboards/planck/keymaps/circuit/config.h
new file mode 100644
index 000000000..22244f4a7
--- /dev/null
+++ b/keyboards/planck/keymaps/circuit/config.h
@@ -0,0 +1,91 @@
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/* Tap-dance interval definition */
24#define TAPPING_TERM 200
25
26/* USB Device descriptor parameter */
27#define VENDOR_ID 0xFEED
28#define PRODUCT_ID 0x6060
29#define MANUFACTURER Ortholinear Keyboards
30#define PRODUCT The Planck Keyboard
31#define DESCRIPTION A compact ortholinear keyboard
32
33/* key matrix size */
34#define MATRIX_ROWS 4
35#define MATRIX_COLS 12
36
37/* Planck PCB default pin-out */
38#define MATRIX_ROW_PINS { D0, D5, B5, B6 }
39#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
40#define UNUSED_PINS
41
42#define BACKLIGHT_PIN B7
43
44/* COL2ROW or ROW2COL */
45#define DIODE_DIRECTION COL2ROW
46
47/* define if matrix has ghost */
48//#define MATRIX_HAS_GHOST
49
50/* number of backlight levels */
51#define BACKLIGHT_LEVELS 3
52
53/* Set 0 if debouncing isn't needed */
54#define DEBOUNCING_DELAY 5
55
56/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
57#define LOCKING_SUPPORT_ENABLE
58/* Locking resynchronize hack */
59#define LOCKING_RESYNC_ENABLE
60
61/* key combination for command */
62#define IS_COMMAND() ( \
63 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
64)
65
66/*
67 * Feature disable options
68 * These options are also useful to firmware size reduction.
69 */
70
71/* disable debug print */
72//#define NO_DEBUG
73
74/* disable print */
75//#define NO_PRINT
76
77/* disable action features */
78//#define NO_ACTION_LAYER
79//#define NO_ACTION_TAPPING
80//#define NO_ACTION_ONESHOT
81//#define NO_ACTION_MACRO
82//#define NO_ACTION_FUNCTION
83
84#ifdef SUBPROJECT_rev3
85 #include "rev3/config.h"
86#endif
87#ifdef SUBPROJECT_rev4
88 #include "rev4/config.h"
89#endif
90
91#endif
diff --git a/keyboards/planck/keymaps/circuit/keyboard-layout.png b/keyboards/planck/keymaps/circuit/keyboard-layout.png
new file mode 100644
index 000000000..e9296a6d9
--- /dev/null
+++ b/keyboards/planck/keymaps/circuit/keyboard-layout.png
Binary files differ
diff --git a/keyboards/planck/keymaps/circuit/keymap.c b/keyboards/planck/keymaps/circuit/keymap.c
new file mode 100644
index 000000000..5096decb9
--- /dev/null
+++ b/keyboards/planck/keymaps/circuit/keymap.c
@@ -0,0 +1,258 @@
1// Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6
2
3#include "planck.h"
4#include "action_layer.h"
5#ifdef AUDIO_ENABLE
6#include "audio.h"
7#endif
8#include "eeconfig.h"
9
10extern keymap_config_t keymap_config;
11
12// Each layer gets a name for readability, which is then used in the keymap matrix below.
13// The underscores don't mean anything - you can have a layer called STUFF or any other name.
14// Layer names don't all need to be of the same length, obviously, and you can also skip them
15// entirely and just use numbers.
16#define _QWERTY 0
17#define _DVORAK 1
18#define _LOCKED 2
19#define _NUMBER 3
20#define _ACTION 4
21#define _FUNCTN 5
22
23enum planck_keycodes {
24 QWERTY = SAFE_RANGE,
25 DVORAK,
26 NUMBER,
27 ACTION
28};
29
30// Key code names
31#define SFT_ENT FUNC(0) // Tap for enter, hold for right shift
32#define LOCK FUNC(1)
33#define KC_PSTE KC_PASTE
34#define _______ KC_TRNS
35#define XXXXXXX KC_NO
36
37#ifdef TAP_DANCE_ENABLE
38#define SFT_CAP TD(0) // Left shift, double tap for caps
39#endif
40#ifndef TAP_DANCE_ENABLE
41#define SFT_CAP KC_LSFT // Regular left shift
42#endif
43
44// Tap Dance Definitions
45#ifdef TAP_DANCE_ENABLE
46const qk_tap_dance_action_t tap_dance_actions[] = {
47 [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS)
48};
49#endif
50
51// Function definitions
52const uint16_t PROGMEM fn_actions[] = {
53 [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT),
54 [1] = ACTION_LAYER_TOGGLE(_LOCKED)
55};
56
57// Layout definitions
58const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
59
60/* QWERTY
61 * ,-----------------------------------------------------------------------------------.
62 * | Esc | Q | W | E | R | T | Y | U | I | O | P | BKSP |
63 * |------+------+------+------+------+------+------+------+------+------+------+------|
64 * | Tab | A | S | D | F | G | H | J | K | L | ; | ' |
65 * |------+------+------+------+------+------+------+------+------+------+------+------|
66 * |*Shift| Z | X | C | V | B | N | M | , | . | Up |SftEnt|
67 * |------+------+------+------+------+-------------+------+------+------+------+------|
68 * | Ctrl | Alt | Cmd | Vol- | ACTN | Space | NUMS | Vol+ | Left | Down | Left |
69 * `-----------------------------------------------------------------------------------'
70 */
71[_QWERTY] = {
72 {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
73 {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
74 {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT},
75 {KC_LCTL, KC_LALT, KC_LGUI, KC_VOLD, ACTION, KC_SPC, KC_SPC, NUMBER, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT}
76},
77
78/* DVORAK
79 * ,-----------------------------------------------------------------------------------.
80 * | | ' | , | . | P | Y | F | G | C | R | L | |
81 * |------+------+------+------+------+------+------+------+------+------+------+------|
82 * | | A | O | E | U | I | D | H | T | N | S | Z |
83 * |------+------+------+------+------+------+------+------+------+------+------+------|
84 * | | ; | Q | J | K | X | B | M | W | V | | |
85 * |------+------+------+------+------+-------------+------+------+------+------+------|
86 * | | | | | | | | | | | |
87 * `-----------------------------------------------------------------------------------'
88 */
89[_DVORAK] = {
90 {_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______},
91 {_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_Z },
92 {_______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, _______, _______},
93 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
94},
95
96/* LOCK
97 * ,-----------------------------------------------------------------------------------.
98 * | | | | | | | | | | | | |
99 * |------+------+------+------+------+------+------+------+------+------+------+------|
100 * | | | | | | | | | | | | |
101 * |------+------+------+------+------+------+------+------+------+------+------+------|
102 * | Shift| | | | | | | | | | | |
103 * |------+------+------+------+------+-------------+------+------+------+------+------|
104 * | | | NULL | | | | | | | | |
105 * `-----------------------------------------------------------------------------------'
106 */
107[_LOCKED] = {
108 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
109 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
110 {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
111 {_______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______}
112},
113
114/* NUMBERS
115 * ,-----------------------------------------------------------------------------------.
116 * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
117 * |------+------+------+------+------+------+------+------+------+------+------+------|
118 * | | ~ | NULL | NULL | NULL | | | _ | + | { | } | ? | / |
119 * |------+------+------+------+------+------+------+------+------+------+------+------|
120 * | | ` | NULL | NULL | NULL | \ | - | = | [ | ] | | |
121 * |------+------+------+------+------+-------------+------+------+------+------+------|
122 * | | | | | | NULL | | | | | |
123 * `-----------------------------------------------------------------------------------'
124 */
125[_NUMBER] = {
126 {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______},
127 {_______, KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUES, KC_SLSH},
128 {_______, KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______},
129 {_______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______}
130},
131
132/* ACTIONS
133 * ,-----------------------------------------------------------------------------------.
134 * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
135 * |------+------+------+------+------+------+------+------+------+------+------+------|
136 * | | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL |
137 * |------+------+------+------+------+------+------+------+------+------+------+------|
138 * | CAPS | Undo | Cut | Copy | Paste| NULL | NULL | NULL | NULL | NULL | PgUp | Enter|
139 * |------+------+------+------+------+-------------+------+------+------+------+------|
140 * | | | | Mute | | NULL | | NULL | Home | PgDn | End |
141 * `-----------------------------------------------------------------------------------'
142 */
143[_ACTION] = {
144 {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL },
145 {_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
146 {KC_CAPS, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_ENT },
147 {_______, _______, _______, KC_MUTE, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_HOME, KC_PGDN, KC_END }
148},
149
150/* FUNCTIONS
151 * ,-----------------------------------------------------------------------------------.
152 * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
153 * |------+------+------+------+------+------+------+------+------+------+------+------|
154 * | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 |
155 * |------+------+------+------+------+------+------+------+------+------+------+------|
156 * | NULL | NULL | NULL | NULL | NULL |QWERTY|DVORAK| NULL | NULL | NULL | NULL | NULL |
157 * |------+------+------+------+------+-------------+------+------+------+------+------|
158 * | Reset| NULL | Lock | NULL | | NULL | | NULL | NULL | NULL | NULL |
159 * `-----------------------------------------------------------------------------------'
160 */
161[_FUNCTN] = {
162 {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 },
163 {KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 },
164 {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY, DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX},
165 {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}
166}
167
168};
169
170#ifdef AUDIO_ENABLE
171float tone_startup[][2] = SONG(STARTUP_SOUND);
172float tone_qwerty[][2] = SONG(QWERTY_SOUND);
173float tone_dvorak[][2] = SONG(DVORAK_SOUND);
174float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
175float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
176#endif
177
178
179bool process_record_user(uint16_t keycode, keyrecord_t *record) {
180 switch (keycode) {
181 case QWERTY:
182 if (record->event.pressed) {
183 if (IS_LAYER_ON(_DVORAK)) {
184#ifdef AUDIO_ENABLE
185 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
186#endif
187 layer_off(_DVORAK);
188 }
189 }
190 return false;
191 break;
192 case DVORAK:
193 if (record->event.pressed) {
194 if (!IS_LAYER_ON(_DVORAK)) {
195#ifdef AUDIO_ENABLE
196 PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
197#endif
198 layer_on(_DVORAK);
199 }
200 }
201 return false;
202 break;
203 case NUMBER:
204 if (record->event.pressed) {
205 layer_on(_NUMBER);
206 update_tri_layer(_NUMBER, _ACTION, _FUNCTN);
207 } else {
208 layer_off(_NUMBER);
209 update_tri_layer(_NUMBER, _ACTION, _FUNCTN);
210 }
211 return false;
212 break;
213 case ACTION:
214 if (record->event.pressed) {
215 layer_on(_ACTION);
216 update_tri_layer(_NUMBER, _ACTION, _FUNCTN);
217 } else {
218 layer_off(_ACTION);
219 update_tri_layer(_NUMBER, _ACTION, _FUNCTN);
220 }
221 return false;
222 break;
223 }
224 return true;
225}
226
227void matrix_init_user(void) {
228#ifdef AUDIO_ENABLE
229 startup_user();
230#endif
231}
232
233#ifdef AUDIO_ENABLE
234
235void startup_user()
236{
237 _delay_ms(20); // gets rid of tick
238 PLAY_NOTE_ARRAY(tone_startup, false, 0);
239}
240
241void shutdown_user()
242{
243 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
244 _delay_ms(150);
245 stop_all_notes();
246}
247
248void music_on_user(void)
249{
250 music_scale_user();
251}
252
253void music_scale_user(void)
254{
255 PLAY_NOTE_ARRAY(music_scale, false, 0);
256}
257
258#endif
diff --git a/keyboards/planck/keymaps/premek/Makefile b/keyboards/planck/keymaps/premek/Makefile
new file mode 100644
index 000000000..0f4953888
--- /dev/null
+++ b/keyboards/planck/keymaps/premek/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
diff --git a/keyboards/planck/keymaps/premek/keymap.c b/keyboards/planck/keymaps/premek/keymap.c
new file mode 100644
index 000000000..9b212ab25
--- /dev/null
+++ b/keyboards/planck/keymaps/premek/keymap.c
@@ -0,0 +1,231 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "planck.h"
5#include "action_layer.h"
6#ifdef AUDIO_ENABLE
7 #include "audio.h"
8#endif
9#include "eeconfig.h"
10
11extern keymap_config_t keymap_config;
12
13// Each layer gets a name for readability, which is then used in the keymap matrix below.
14// The underscores don't mean anything - you can have a layer called STUFF or any other name.
15// Layer names don't all need to be of the same length, obviously, and you can also skip them
16// entirely and just use numbers.
17#define _QWERTY 0
18#define _COLEMAK 1
19#define _DVORAK 2
20#define _LOWER 3
21#define _RAISE 4
22#define _PLOVER 5
23#define _ADJUST 16
24
25enum planck_keycodes {
26 QWERTY = SAFE_RANGE,
27 COLEMAK,
28 DVORAK,
29 PLOVER,
30 LOWER,
31 RAISE,
32 BACKLIT,
33 EXT_PLV
34};
35
36// Fillers to make layering more clear
37#define _______ KC_TRNS
38#define XXXXXXX KC_NO
39
40const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
41
42[_QWERTY] = {
43 {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_DEL, KC_Y, KC_U, KC_I, KC_O, KC_P },
44 {KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
45 {KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH},
46 {KC_LGUI, _______, _______, KC_LALT, LOWER, KC_SPC, KC_ENT, KC_SPC, RAISE, KC_RALT, _______, KC_RGUI}
47},
48[_COLEMAK] = {
49 {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
50 {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
51 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
52 {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
53},
54[_DVORAK] = {
55 {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
56 {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH},
57 {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT },
58 {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
59},
60[_LOWER] = {
61 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0},
62 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_HOME, KC_PGDN, KC_PGUP, KC_END },
63 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_F12, KC_PLUS, KC_PIPE, KC_LCBR, KC_RCBR},
64 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
65},
66[_RAISE] = {
67 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN},
68 {_______, _______, _______, KC_QUOT, KC_MINS, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT},
69 {_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, _______, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR},
70 {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY}
71},
72
73[_PLOVER] = {
74 {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
75 {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
76 {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
77 {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
78},
79[_ADJUST] = {
80 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
81 {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______},
82 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
83 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
84}
85
86
87};
88
89#ifdef AUDIO_ENABLE
90
91float tone_startup[][2] = SONG(STARTUP_SOUND);
92float tone_qwerty[][2] = SONG(QWERTY_SOUND);
93float tone_dvorak[][2] = SONG(DVORAK_SOUND);
94float tone_colemak[][2] = SONG(COLEMAK_SOUND);
95float tone_plover[][2] = SONG(PLOVER_SOUND);
96float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
97float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
98
99float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
100#endif
101
102
103void persistant_default_layer_set(uint16_t default_layer) {
104 eeconfig_update_default_layer(default_layer);
105 default_layer_set(default_layer);
106}
107
108bool process_record_user(uint16_t keycode, keyrecord_t *record) {
109 switch (keycode) {
110 case QWERTY:
111 if (record->event.pressed) {
112 #ifdef AUDIO_ENABLE
113 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
114 #endif
115 persistant_default_layer_set(1UL<<_QWERTY);
116 }
117 return false;
118 break;
119 case COLEMAK:
120 if (record->event.pressed) {
121 #ifdef AUDIO_ENABLE
122 PLAY_NOTE_ARRAY(tone_colemak, false, 0);
123 #endif
124 persistant_default_layer_set(1UL<<_COLEMAK);
125 }
126 return false;
127 break;
128 case DVORAK:
129 if (record->event.pressed) {
130 #ifdef AUDIO_ENABLE
131 PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
132 #endif
133 persistant_default_layer_set(1UL<<_DVORAK);
134 }
135 return false;
136 break;
137 case LOWER:
138 if (record->event.pressed) {
139 layer_on(_LOWER);
140 update_tri_layer(_LOWER, _RAISE, _ADJUST);
141 } else {
142 layer_off(_LOWER);
143 update_tri_layer(_LOWER, _RAISE, _ADJUST);
144 }
145 return false;
146 break;
147 case RAISE:
148 if (record->event.pressed) {
149 layer_on(_RAISE);
150 update_tri_layer(_LOWER, _RAISE, _ADJUST);
151 } else {
152 layer_off(_RAISE);
153 update_tri_layer(_LOWER, _RAISE, _ADJUST);
154 }
155 return false;
156 break;
157 case BACKLIT:
158 if (record->event.pressed) {
159 register_code(KC_RSFT);
160 #ifdef BACKLIGHT_ENABLE
161 backlight_step();
162 #endif
163 } else {
164 unregister_code(KC_RSFT);
165 }
166 return false;
167 break;
168 case PLOVER:
169 if (record->event.pressed) {
170 #ifdef AUDIO_ENABLE
171 stop_all_notes();
172 PLAY_NOTE_ARRAY(tone_plover, false, 0);
173 #endif
174 layer_off(_RAISE);
175 layer_off(_LOWER);
176 layer_off(_ADJUST);
177 layer_on(_PLOVER);
178 if (!eeconfig_is_enabled()) {
179 eeconfig_init();
180 }
181 keymap_config.raw = eeconfig_read_keymap();
182 keymap_config.nkro = 1;
183 eeconfig_update_keymap(keymap_config.raw);
184 }
185 return false;
186 break;
187 case EXT_PLV:
188 if (record->event.pressed) {
189 #ifdef AUDIO_ENABLE
190 PLAY_NOTE_ARRAY(tone_plover_gb, false, 0);
191 #endif
192 layer_off(_PLOVER);
193 }
194 return false;
195 break;
196 }
197 return true;
198}
199
200void matrix_init_user(void) {
201 #ifdef AUDIO_ENABLE
202 startup_user();
203 #endif
204}
205
206#ifdef AUDIO_ENABLE
207
208void startup_user()
209{
210 _delay_ms(20); // gets rid of tick
211 PLAY_NOTE_ARRAY(tone_startup, false, 0);
212}
213
214void shutdown_user()
215{
216 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
217 _delay_ms(150);
218 stop_all_notes();
219}
220
221void music_on_user(void)
222{
223 music_scale_user();
224}
225
226void music_scale_user(void)
227{
228 PLAY_NOTE_ARRAY(music_scale, false, 0);
229}
230
231#endif
diff --git a/keyboards/planck/keymaps/premek/readme.md b/keyboards/planck/keymaps/premek/readme.md
new file mode 100644
index 000000000..16debdd63
--- /dev/null
+++ b/keyboards/planck/keymaps/premek/readme.md
@@ -0,0 +1,4 @@
1# Split Layout
2Inspired by TECK
3
4[Layout](http://www.keyboard-layout-editor.com/##@_switchMount=cherry&switchBrand=gateron&switchType=KS-3-Tea&pcb:true%3B&@_c=%23e6e6e6&t=%23757575&a:7&fa@:5%3B%3B&=Esc&_a:4&fa@:5&:0&:0&:0&:0&:0&:0&:0&:0&:5%3B%3B&=%0A%0A!%0A1%0A%0A%0A%0A%0A%0AQ&=%0A%0A%2F@%0A2%0A%0A%0A%0A%0A%0AW&=%0A%0A%23%0A3%0A%0A%0A%0A%0A%0AE&=%0A%0A$%0A4%0A%0A%0A%0A%0A%0AR&=%0A%0A%25%0A5%0A%0A%0A%0A%0A%0AT&_c=%23e3b02d&a:7%3B&=Del&_c=%23e6e6e6&a:4%3B&=%0A%0A%5E%0A6%0A%0A%0A%0A%0A%0AY&=%0A%0A%2F&%0A7%0A%0A%0A%0A%0A%0AU&=%0A%0A*%0A8%0A%0A%0A%0A%0A%0AI&=%0A%0A(%0A9%0A%0A%0A%0A%0A%0AO&=%0A%0A)%0A0%0A%0A%0A%0A%0A%0AP%3B&@_a:7%3B&=Shift&_a:4%3B&=%0A%0A%0AF1%0A%0A%0A%0A%0A%0AA&=%0A%0A%0AF2%0A%0A%0A%0A%0A%0AS&=%0A%0A'%0AF3%0A%0A%0A%0A%0A%0AD&_c=%23e3b02d&n:true%3B&=%0A%0A-%0AF4%0A%0A%0A%0A%0A%0AF&_c=%23e6e6e6%3B&=%0A%0A%0AF5%0A%0A%0A%0A%0A%0AG&_c=%23e3b02d&a:7%3B&=Tab&_c=%23e6e6e6&a:4%3B&=%0A%0A%0AF6%0A%0A%0A%0A%0A%0AH&_c=%23e3b02d&n:true%3B&=%0A%0A%2F&larr%2F%3B%0AHom%0A%0A%0A%0A%0A%0AJ&_c=%23e6e6e6%3B&=%0A%0A%2F&darr%2F%3B%0APgD%0A%0A%0A%0A%0A%0AK&=%0A%0A%2F&uarr%2F%3B%0APgU%0A%0A%0A%0A%0A%0AL&=%0A%0A%2F&rarr%2F%3B%0AEnd%0A%0A%0A%0A%0A%0A%2F%3B%3B&@_a:7%3B&=Ctrl&_a:4%3B&=%0A%0A~%0AF7%0A%0A%0A%0A%0A%0AZ&=%0A%0A%60%0AF8%0A%0A%0A%0A%0A%0AX&=%0A%0A+%0AF9%0A%0A%0A%0A%0A%0AC&=%0A%0A%2F=%0AF10%0A%0A%0A%0A%0A%0AV&=%0A%0A%7C%0AF11%0A%0A%0A%0A%0A%0AB&_c=%23e3b02d&a:7%3B&=BSp&_c=%23e6e6e6&a:4%3B&=%0A%0A%5C%0AF12%0A%0A%0A%0A%0A%0AN&=%0A%0A%5B%0A%0A%0A%0A%0A%0A%0AM&=%0A%0A%5D%0A%0A%0A%0A%0A%0A%0A,&=%0A%0A%7B%0A%0A%0A%0A%0A%0A%0A.&=%0A%0A%7D%0A%0A%0A%0A%0A%0A%0A%2F%2F%3B&@_a:7%3B&=&=&=&=Alt&_c=%23e3b02d%3B&=%2F&dArr%2F%3B&_c=%23e6e6e6%3B&=spc&_c=%23e3b02d%3B&=%2F&crarr%2F%3B&_c=%23e6e6e6%3B&=spc&_c=%23e3b02d%3B&=%2F&uArr%2F%3B&_c=%23e6e6e6%3B&=Alt&=&=)
diff --git a/keyboards/preonic/keymaps/kinesis/keymap.c b/keyboards/preonic/keymaps/kinesis/keymap.c
index 1cd6eb993..9691be91d 100644
--- a/keyboards/preonic/keymaps/kinesis/keymap.c
+++ b/keyboards/preonic/keymaps/kinesis/keymap.c
@@ -123,7 +123,7 @@ void music_scale_user(void)
123} 123}
124 124
125 125
126const qk_tap_dance_action_t tap_dance_actions[] = { 126qk_tap_dance_action_t tap_dance_actions[] = {
127 //Tap once for equal, twice for hyper + X (alfred lock) 127 //Tap once for equal, twice for hyper + X (alfred lock)
128 [TD_EQ_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, HYPR(KC_X)), 128 [TD_EQ_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, HYPR(KC_X)),
129 //Tap once for minus, twice for time.heals.nothing 129 //Tap once for minus, twice for time.heals.nothing
diff --git a/keyboards/satan/keymaps/iso_split_rshift/.gitignore b/keyboards/satan/keymaps/iso_split_rshift/.gitignore
new file mode 100644
index 000000000..4d652661c
--- /dev/null
+++ b/keyboards/satan/keymaps/iso_split_rshift/.gitignore
@@ -0,0 +1,3 @@
1updatemerge.sh
2clear_flash.hex
3resetboard.sh
diff --git a/keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpg b/keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpg
new file mode 100644
index 000000000..7616693f9
--- /dev/null
+++ b/keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpg
Binary files differ
diff --git a/keyboards/satan/keymaps/iso_split_rshift/Makefile b/keyboards/satan/keymaps/iso_split_rshift/Makefile
new file mode 100644
index 000000000..d1e07da3f
--- /dev/null
+++ b/keyboards/satan/keymaps/iso_split_rshift/Makefile
@@ -0,0 +1,16 @@
1BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = no # Mouse keys(+4700)
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
4CONSOLE_ENABLE = yes # Console for debug(+400)
5COMMAND_ENABLE = yes # Commands for debug and configuration
6NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
7RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870)
8BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150)
9MIDI_ENABLE = no # MIDI controls
10AUDIO_ENABLE = no
11UNICODE_ENABLE = no # Unicode
12BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
13
14ifndef QUANTUM_DIR
15 include ../../../../Makefile
16endif
diff --git a/keyboards/satan/keymaps/iso_split_rshift/build.sh b/keyboards/satan/keymaps/iso_split_rshift/build.sh
new file mode 100755
index 000000000..6b4b4568f
--- /dev/null
+++ b/keyboards/satan/keymaps/iso_split_rshift/build.sh
@@ -0,0 +1,42 @@
1#!/bin/bash
2# adjust for cpu
3# -j 16 gave best result on a hyperthreaded quad core core i7
4
5LIMIT=10
6THREADS="-j 16"
7KMAP=iso_split_rshift
8
9echo "We need sudo later"
10sudo ls 2>&1 /dev/null
11
12function wait_bootloader {
13 echo "Waiting for Bootloader..."
14 local STARTTIME=$(date +"%s")
15 local REMIND=0
16 local EXEC=dfu-programmer
17 local TARGET=atmega32u4
18 while true
19 do
20 sudo $EXEC $TARGET get > /dev/null 2>&1
21 [ $? -eq 0 ] && break
22 ENDTIME=$(date +"%s")
23 DURATION=$(($ENDTIME-$STARTTIME))
24 if [ $REMIND -eq 0 -a $DURATION -gt $LIMIT ]
25 then
26 echo "Did you forget to press the reset button?"
27 REMIND=1
28 fi
29 sleep 1
30 done
31}
32make clean
33make KEYMAP=${KMAP} ${THREADS}
34if [[ $? -eq 0 ]]
35then
36 echo "please trigger flashing!"
37 wait_bootloader
38 sudo make KEYMAP=${KMAP} dfu ${THREADS}
39else
40 echo "make failed"
41 exit 77
42fi
diff --git a/keyboards/satan/keymaps/iso_split_rshift/config.h b/keyboards/satan/keymaps/iso_split_rshift/config.h
new file mode 100644
index 000000000..27c1372da
--- /dev/null
+++ b/keyboards/satan/keymaps/iso_split_rshift/config.h
@@ -0,0 +1,27 @@
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_USER_H
19#define CONFIG_USER_H
20
21#include "../../config.h"
22
23// only change
24#undef RGB_DI_PIN
25#define RGB_DI_PIN B2
26
27#endif
diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c
new file mode 100644
index 000000000..bc5bfe2e6
--- /dev/null
+++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c
@@ -0,0 +1,209 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "satan.h"
5// TODO: replace your ugly german brckets with #defines
6
7// Each layer gets a name for readability, which is then used in the keymap matrix below.
8// The underscores don't mean anything - you can have a layer called STUFF or any other name.
9// Layer names don't all need to be of the same length, obviously, and you can also skip them
10// entirely and just use numbers.
11#define _DEF 0
12#define _SPC 1
13#define _TAB 2
14#define _SFX 3
15
16// dual-role shortcuts
17#define TABDUAL LT(_TAB, KC_TAB)
18#define CAPSDUAL CTL_T(KC_ESC)
19#define SPACEDUAL LT(_SPC, KC_SPACE)
20#define ENTERDUAL CTL_T(KC_ENT)
21// arrow cluster duality bottom right corner
22#define ARRLEFT ALT_T(KC_LEFT)
23#define ARRDOWN GUI_T(KC_DOWN)
24#define ARRUP SFT_T(KC_UP)
25#define ARRRIGHT CTL_T(KC_RIGHT)
26// german brackets
27#define GER_CUR_L RALT(KC_7) // [
28#define GER_CUR_R RALT(KC_0) // ]
29#define GER_PAR_L LSFT(KC_8) // (
30#define GER_PAR_R LSFT(KC_9) // )
31#define GER_ANG_L KC_NUBS // <
32#define GER_ANG_R LSFT(KC_NUBS) // >
33#define GER_BRC_L RALT(KC_8) // [
34#define GER_BRC_R RALT(KC_9) // ]
35
36// increase readability
37#define _______ KC_TRNS
38#define XXXXXXX KC_NO
39
40const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
41 /* Keymap _DEF: Default Layer
42 * ,-----------------------------------------------------------.
43 * |Grv| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
44 * |-----------------------------------------------------------|
45 * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Tab is Fn1
46 * |-----------------------------------------------------------|
47 * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return |
48 * |-----------------------------------------------------------|
49 * |Sft | < | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| RShift is UP
50 * |-----------------------------------------------------------|
51 * |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl| Gui Menu, RCtrl is
52 * `-----------------------------------------------------------' LEFT DWN RIGHT
53 */
54 [_DEF] = KEYMAP_ISO_SPLITRSHIFT(
55 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
56 TABDUAL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
57 CAPSDUAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, ENTERDUAL, \
58 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX), ARRUP, \
59 KC_LCTL, KC_LGUI, KC_LALT, SPACEDUAL, KC_RALT, ARRLEFT, ARRDOWN, ARRRIGHT),
60
61 /* Keymap 1: F-and-vim Layer, modified with Space (by holding space)
62 * ,-----------------------------------------------------------.
63 * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete|
64 * |-----------------------------------------------------------|
65 * | |Paus| Up| [ | ] | | | | ( | ) | | | | |
66 * |-----------------------------------------------------------|
67 * | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY |
68 * |-----------------------------------------------------------|
69 * | | | | | < | > | |M0 | | | | | Vol+ | |
70 * |-----------------------------------------------------------|
71 * | | | | |Alt |Prev|Vol-|Next|
72 * `-----------------------------------------------------------'
73 */
74 [_SPC] = KEYMAP_ISO_SPLITRSHIFT(
75 KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \
76 _______, KC_PAUS, KC_UP, GER_BRC_L, GER_BRC_R, _______, _______, GER_PAR_L, GER_PAR_R, _______, _______, _______, _______, _______, \
77 _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \
78 _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, _______, KC_VOLU, \
79 _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT),
80
81 /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab)
82 * ,-----------------------------------------------------------.
83 * |WAKE| | | | | | | | | | | | |Insert| TAB+GRC = WAKE
84 * |-----------------------------------------------------------|
85 * | | | | | | | | | { | } | | | | |
86 * |-----------------------------------------------------------|
87 * | | | | | | |Pos1|PgDn|PgUp|End| | |Retrn |
88 * |-----------------------------------------------------------|
89 * | | | | | | | |AF2| | | | | PgUp | |
90 * |-----------------------------------------------------------|
91 * | | | | |Alt |Pos1|PgDn|End |
92 * `-----------------------------------------------------------'
93 */
94 [_TAB] = KEYMAP_ISO_SPLITRSHIFT(
95 KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \
96 _______, _______, _______, _______, _______, _______, _______, GER_CUR_L, GER_CUR_R, _______, _______, _______, _______, _______, \
97 _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \
98 _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, _______, KC_PGUP, \
99 _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END),
100
101 /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key)
102 * ,-----------------------------------------------------------.
103 * |RSET| | | | | | | 7| 8| 9| | | |Backsp |
104 * |-----------------------------------------------------------|
105 * | | | | | | | | 4 | 5 | 6 | | | | \ |
106 * |-----------------------------------------------------------|
107 * | | L | L | | | | | 1 | 2 | 3 | | | Return |
108 * |-----------------------------------------------------------|
109 * | | | L | L | L | L | L | L | | 0 | | /| Up | | All "L"s represent
110 * |-----------------------------------------------------------| LED controlling
111 * |Ctrl|Win |Alt | |Alt |Left|Down|Right|
112 * `-----------------------------------------------------------'
113 */
114 [_SFX] = KEYMAP_ISO_SPLITRSHIFT(
115 RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \
116 _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \
117 _______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \
118 _______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, _______, KC_UP, \
119 _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT),
120};
121
122enum function_id {
123 LAUNCH,
124 RGBLED_TOGGLE,
125 RGBLED_STEP_MODE,
126 RGBLED_INCREASE_HUE,
127 RGBLED_DECREASE_HUE,
128 RGBLED_INCREASE_SAT,
129 RGBLED_DECREASE_SAT,
130 RGBLED_INCREASE_VAL,
131 RGBLED_DECREASE_VAL,
132};
133
134const uint16_t PROGMEM fn_actions[] = {
135 [1] = ACTION_FUNCTION(LAUNCH),
136 [2] = ACTION_FUNCTION(RGBLED_TOGGLE),
137 [3] = ACTION_FUNCTION(RGBLED_STEP_MODE),
138 [4] = ACTION_FUNCTION(RGBLED_INCREASE_HUE),
139 [5] = ACTION_FUNCTION(RGBLED_DECREASE_HUE),
140 [6] = ACTION_FUNCTION(RGBLED_INCREASE_SAT),
141 [7] = ACTION_FUNCTION(RGBLED_DECREASE_SAT),
142 [8] = ACTION_FUNCTION(RGBLED_INCREASE_VAL),
143 [9] = ACTION_FUNCTION(RGBLED_DECREASE_VAL),
144 [10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT),
145};
146
147const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
148{
149 // MACRODOWN only works in this function
150 switch(id) {
151 case 0:
152 return (record->event.pressed ?
153 MACRO( D(RALT), T(SPC), U(RALT), END )
154 :MACRO( END ));
155 break;
156 case 1:
157 return (record->event.pressed ?
158 MACRO( D(LALT), T(F2), U(LALT), END )
159 :MACRO( END ));
160 break;
161 }
162 return MACRO_NONE;
163};
164
165void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
166 switch (id) {
167 case RGBLED_TOGGLE:
168 //led operations
169 if (record->event.pressed) {
170 rgblight_toggle();
171 }
172 break;
173 case RGBLED_INCREASE_HUE:
174 if (record->event.pressed) {
175 rgblight_increase_hue();
176 }
177 break;
178 case RGBLED_DECREASE_HUE:
179 if (record->event.pressed) {
180 rgblight_decrease_hue();
181 }
182 break;
183 case RGBLED_INCREASE_SAT:
184 if (record->event.pressed) {
185 rgblight_increase_sat();
186 }
187 break;
188 case RGBLED_DECREASE_SAT:
189 if (record->event.pressed) {
190 rgblight_decrease_sat();
191 }
192 break;
193 case RGBLED_INCREASE_VAL:
194 if (record->event.pressed) {
195 rgblight_increase_val();
196 }
197 break;
198 case RGBLED_DECREASE_VAL:
199 if (record->event.pressed) {
200 rgblight_decrease_val();
201 }
202 break;
203 case RGBLED_STEP_MODE:
204 if (record->event.pressed) {
205 rgblight_step();
206 }
207 break;
208 }
209}
diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md
new file mode 100644
index 000000000..ec6123d8a
--- /dev/null
+++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md
@@ -0,0 +1,36 @@
1toneman77's Satan Layout
2=====================
3
4##Quantum MK Firmware
5For the full Quantum feature list, see the parent readme.md.
6
7* heavily modified ISO (!) layout with split right shift key
8* spaceFn
9* Dual-Role keys:
10*
11 | Original key | when tapped | when held |
12 | ---------------- | ------------- | ------------- |
13 | Space | Space | layer change |
14 | Caps lock | Escape | Control |
15 | Tab | Tab | layer change |
16 | Enter | Enter | Control |
17
18* Lockable layer for LED functions and numpad
19* vim-style arrow keys on hjkl (spacefn layer)
20* corresponding Home/PgDn/PgUp/End on hjkl (tab layer)
21* bonus arrow keys in the bottom right corner on Alt/Win/Menu/rCtrl/Shift
22* more bonus arrow keys on wasd (spacefn layer)
23* media keys prev/next/play/vol+/vol- (spacefn layer)
24* firmware bootloader button
25* WS2812 RGB Underglow Support (not needed anymore to solder directly to the atmega)
26* additional brackets that only work in german layout due to horrible placement
27in the default qwertz layout
28
29
30### Additional Credits
31* Keymap has been based on TerryMathews' fork of Aqoush's fork of qmk-satan-rgb. [here](https://github.com/TerryMathews/qmk-satan-rgb/tree/master/keyboard/satan)
32* nice visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48)
33* no-need-to-solder-on-chip picture:
34![no need to solder directly on the chip anymore](LEDpinSatan.jpg)
35* special thanks to /u/TerryMathews who suggested the pin PB2, so soldering
36directly on the atmega is not needed anymore. Happened on [reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/4ghq9z/photos_satan_rgb60_w1976/d2k5tra)
diff --git a/keyboards/satan/keymaps/iso_split_rshift/resetboard.sh b/keyboards/satan/keymaps/iso_split_rshift/resetboard.sh
new file mode 100755
index 000000000..d955ccf54
--- /dev/null
+++ b/keyboards/satan/keymaps/iso_split_rshift/resetboard.sh
@@ -0,0 +1,4 @@
1#!/bin/bash
2sudo dfu-programmer atmega32u4 erase --force
3sudo dfu-programmer atmega32u4 flash clear_flash.hex
4sudo dfu-programmer atmega32u4 reset
diff --git a/keyboards/satan/satan.h b/keyboards/satan/satan.h
index 513446bf3..cbc8c91bd 100644
--- a/keyboards/satan/satan.h
+++ b/keyboards/satan/satan.h
@@ -62,6 +62,33 @@
62 {k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, k49, k4a, k4b, k4c, k4d} \ 62 {k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, k49, k4a, k4b, k4c, k4d} \
63} 63}
64 64
65/* ISO w/ split right shift key matrix layout
66 * ,-----------------------------------------------------------.
67 * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d |
68 * |-----------------------------------------------------------|
69 * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d |
70 * |-----------------------------------------------------------|
71 * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2c|2d |
72 * |-----------------------------------------------------------|
73 * | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3c| 3d |
74 * |-----------------------------------------------------------|
75 * | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d |
76 * `-----------------------------------------------------------'
77 */
78#define KEYMAP_ISO_SPLITRSHIFT( \
79 k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
80 k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
81 k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
82 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \
83 k40, k41, k42, k45, k4a, k4b, k4c, k4d \
84) \
85{ \
86 {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \
87 {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \
88 {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \
89 {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \
90 {k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d} \
91}
65 92
66void matrix_init_user(void); 93void matrix_init_user(void);
67void matrix_scan_user(void); 94void matrix_scan_user(void);
diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c
index 5429e3438..e152f2350 100644
--- a/quantum/process_keycode/process_tap_dance.c
+++ b/quantum/process_keycode/process_tap_dance.c
@@ -1,18 +1,8 @@
1#include "quantum.h" 1#include "quantum.h"
2#include "action_tapping.h"
2 3
3static qk_tap_dance_state_t qk_tap_dance_state; 4static uint16_t last_td;
4bool td_debug_enable = false; 5static int8_t highest_td = -1;
5
6#if CONSOLE_ENABLE
7#define td_debug(s) if (td_debug_enable) \
8 { \
9 xprintf ("D:tap_dance:%s:%s = { keycode = %d, count = %d, active = %d, pressed = %d }\n", __FUNCTION__, s, \
10 qk_tap_dance_state.keycode, qk_tap_dance_state.count, \
11 qk_tap_dance_state.active, qk_tap_dance_state.pressed); \
12 }
13#else
14#define td_debug(s)
15#endif
16 6
17void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data) { 7void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data) {
18 qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; 8 qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data;
@@ -35,98 +25,110 @@ void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data) {
35} 25}
36 26
37static inline void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, 27static inline void _process_tap_dance_action_fn (qk_tap_dance_state_t *state,
38 void *user_data, 28 void *user_data,
39 qk_tap_dance_user_fn_t fn) 29 qk_tap_dance_user_fn_t fn)
40{ 30{
41 if (fn) { 31 if (fn) {
42 fn(state, user_data); 32 fn(state, user_data);
43 } 33 }
44} 34}
45 35
46static inline void process_tap_dance_action_on_each_tap (qk_tap_dance_action_t action) 36static inline void process_tap_dance_action_on_each_tap (qk_tap_dance_action_t *action)
47{ 37{
48 td_debug("trigger"); 38 _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_each_tap);
49 _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_each_tap);
50} 39}
51 40
52static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_action_t action) 41static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_action_t *action)
53{ 42{
54 td_debug("trigger"); 43 if (action->state.finished)
55 _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_dance_finished); 44 return;
45 action->state.finished = true;
46 _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_dance_finished);
56} 47}
57 48
58static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t action) 49static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t *action)
59{ 50{
60 td_debug("trigger") 51 _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_reset);
61 _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_reset);
62} 52}
63 53
64bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { 54bool process_tap_dance(uint16_t keycode, keyrecord_t *record) {
65 bool r = true;
66 uint16_t idx = keycode - QK_TAP_DANCE; 55 uint16_t idx = keycode - QK_TAP_DANCE;
67 qk_tap_dance_action_t action; 56 qk_tap_dance_action_t *action;
57
58 if (last_td && last_td != keycode) {
59 (&tap_dance_actions[last_td - QK_TAP_DANCE])->state.interrupted = true;
60 }
68 61
69 switch(keycode) { 62 switch(keycode) {
70 case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: 63 case QK_TAP_DANCE ... QK_TAP_DANCE_MAX:
71 action = tap_dance_actions[idx]; 64 if ((int16_t)idx > highest_td)
72 65 highest_td = idx;
73 process_tap_dance_action_on_each_tap (action); 66 action = &tap_dance_actions[idx];
74 if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) {
75 process_tap_dance_action_on_dance_finished (action);
76 } else if (qk_tap_dance_state.active && qk_tap_dance_state.pressed) {
77 reset_tap_dance (&qk_tap_dance_state);
78 } else {
79 r = false;
80 }
81 67
82 qk_tap_dance_state.active = true; 68 action->state.keycode = keycode;
83 qk_tap_dance_state.pressed = record->event.pressed; 69 action->state.pressed = record->event.pressed;
84 if (record->event.pressed) { 70 if (record->event.pressed) {
85 qk_tap_dance_state.keycode = keycode; 71 action->state.count++;
86 qk_tap_dance_state.timer = timer_read (); 72 action->state.timer = timer_read();
87 qk_tap_dance_state.count++; 73
74 if (last_td && last_td != keycode) {
75 qk_tap_dance_action_t *paction = &tap_dance_actions[last_td - QK_TAP_DANCE];
76 paction->state.interrupted = true;
77 process_tap_dance_action_on_dance_finished (paction);
78 reset_tap_dance (&paction->state);
79 }
88 } 80 }
81 last_td = keycode;
82
89 break; 83 break;
90 84
91 default: 85 default:
92 if (qk_tap_dance_state.keycode) { 86 if (!record->event.pressed)
93 // if we are here, the tap dance was interrupted by a different key 87 return true;
94 idx = qk_tap_dance_state.keycode - QK_TAP_DANCE; 88
95 action = tap_dance_actions[idx]; 89 if (highest_td == -1)
90 return true;
96 91
97 process_tap_dance_action_on_each_tap (action); 92 for (int i = 0; i <= highest_td; i++) {
93 action = &tap_dance_actions[i];
94 if (action->state.count == 0)
95 continue;
96 action->state.interrupted = true;
98 process_tap_dance_action_on_dance_finished (action); 97 process_tap_dance_action_on_dance_finished (action);
99 reset_tap_dance (&qk_tap_dance_state); 98 reset_tap_dance (&action->state);
100 qk_tap_dance_state.active = false;
101 } 99 }
102 break; 100 break;
103 } 101 }
104 102
105 return r; 103 return true;
106} 104}
107 105
108void matrix_scan_tap_dance () { 106void matrix_scan_tap_dance () {
109 if (qk_tap_dance_state.active && timer_elapsed (qk_tap_dance_state.timer) > TAPPING_TERM) { 107 if (highest_td == -1)
110 // if we are here, the tap dance was timed out 108 return;
111 uint16_t idx = qk_tap_dance_state.keycode - QK_TAP_DANCE; 109
112 qk_tap_dance_action_t action = tap_dance_actions[idx]; 110 for (int i = 0; i <= highest_td; i++) {
111 qk_tap_dance_action_t *action = &tap_dance_actions[i];
113 112
114 process_tap_dance_action_on_dance_finished (action); 113 if (action->state.count && timer_elapsed (action->state.timer) > TAPPING_TERM) {
115 reset_tap_dance (&qk_tap_dance_state); 114 process_tap_dance_action_on_dance_finished (action);
115 reset_tap_dance (&action->state);
116 }
116 } 117 }
117} 118}
118 119
119void reset_tap_dance (qk_tap_dance_state_t *state) { 120void reset_tap_dance (qk_tap_dance_state_t *state) {
120 uint16_t idx = state->keycode - QK_TAP_DANCE; 121 qk_tap_dance_action_t *action;
121 qk_tap_dance_action_t action;
122 122
123 if (state->pressed) 123 if (state->pressed)
124 return; 124 return;
125 125
126 action = tap_dance_actions[idx]; 126 action = &tap_dance_actions[state->keycode - QK_TAP_DANCE];
127
127 process_tap_dance_action_on_reset (action); 128 process_tap_dance_action_on_reset (action);
128 129
129 state->keycode = 0;
130 state->count = 0; 130 state->count = 0;
131 state->active = false; 131 state->interrupted = false;
132 state->finished = false;
133 last_td = 0;
132} 134}
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h
index 6a1258067..d7b857bdc 100644
--- a/quantum/process_keycode/process_tap_dance.h
+++ b/quantum/process_keycode/process_tap_dance.h
@@ -11,8 +11,9 @@ typedef struct
11 uint8_t count; 11 uint8_t count;
12 uint16_t keycode; 12 uint16_t keycode;
13 uint16_t timer; 13 uint16_t timer;
14 bool active:1; 14 bool interrupted;
15 bool pressed:1; 15 bool pressed;
16 bool finished;
16} qk_tap_dance_state_t; 17} qk_tap_dance_state_t;
17 18
18#define TD(n) (QK_TAP_DANCE + n) 19#define TD(n) (QK_TAP_DANCE + n)
@@ -26,6 +27,7 @@ typedef struct
26 qk_tap_dance_user_fn_t on_dance_finished; 27 qk_tap_dance_user_fn_t on_dance_finished;
27 qk_tap_dance_user_fn_t on_reset; 28 qk_tap_dance_user_fn_t on_reset;
28 } fn; 29 } fn;
30 qk_tap_dance_state_t state;
29 void *user_data; 31 void *user_data;
30} qk_tap_dance_action_t; 32} qk_tap_dance_action_t;
31 33
@@ -48,8 +50,7 @@ typedef struct
48 .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset } \ 50 .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset } \
49 } 51 }
50 52
51extern const qk_tap_dance_action_t tap_dance_actions[]; 53extern qk_tap_dance_action_t tap_dance_actions[];
52extern bool td_debug_enable;
53 54
54/* To be used internally */ 55/* To be used internally */
55 56
diff --git a/readme.md b/readme.md
index e2221e749..8c07a5d1f 100644
--- a/readme.md
+++ b/readme.md
@@ -431,7 +431,7 @@ enum {
431}; 431};
432 432
433//Tap Dance Definitions 433//Tap Dance Definitions
434const qk_tap_dance_action_t tap_dance_actions[] = { 434qk_tap_dance_action_t tap_dance_actions[] = {
435 //Tap once for Esc, twice for Caps Lock 435 //Tap once for Esc, twice for Caps Lock
436 [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) 436 [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS)
437// Other declarations would go here, separated by commas, if you have them 437// Other declarations would go here, separated by commas, if you have them
@@ -517,7 +517,7 @@ void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
517 ergodox_right_led_3_off(); 517 ergodox_right_led_3_off();
518} 518}
519 519
520const qk_tap_dance_action_t tap_dance_actions[] = { 520qk_tap_dance_action_t tap_dance_actions[] = {
521 [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT) 521 [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT)
522 ,[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset) 522 ,[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset)
523 ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg) 523 ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg)