aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXScorpion2 <rcalt2vt@gmail.com>2019-04-29 22:21:46 -0500
committerDrashna Jaelre <drashna@live.com>2019-04-29 20:21:46 -0700
commitc745d9b82e3f2047feb97a7a8937f27c6e989fd7 (patch)
tree503962c0a0aafa20c6c84bce0bf704b49cd98dd9
parent7d4ae3e66ebe1e9ff52ad4eb87da8cd9f01c142a (diff)
downloadqmk_firmware-c745d9b82e3f2047feb97a7a8937f27c6e989fd7.tar.gz
qmk_firmware-c745d9b82e3f2047feb97a7a8937f27c6e989fd7.zip
Simple extended space cadet (#5277)
* Simplifying and Extending Space Cadet to work on Ctrl and Alt keys * PR Review feedback * Reverting back to keycodes
-rw-r--r--common_features.mk6
-rw-r--r--docs/_summary.md3
-rw-r--r--docs/feature_space_cadet.md59
-rw-r--r--docs/feature_space_cadet_shift.md37
-rw-r--r--docs/feature_space_cadet_shift_enter.md31
-rw-r--r--quantum/process_keycode/process_space_cadet.c146
-rw-r--r--quantum/process_keycode/process_space_cadet.h21
-rw-r--r--quantum/quantum.c123
-rw-r--r--quantum/quantum.h4
-rw-r--r--quantum/quantum_keycodes.h12
10 files changed, 252 insertions, 190 deletions
diff --git a/common_features.mk b/common_features.mk
index 8e9bcf0b9..6dffe31ff 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -351,3 +351,9 @@ ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
351 QUANTUM_LIB_SRC += i2c_master.c 351 QUANTUM_LIB_SRC += i2c_master.c
352 SRC += oled_driver.c 352 SRC += oled_driver.c
353endif 353endif
354
355SPACE_CADET_ENABLE ?= yes
356ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
357 SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c
358 OPT_DEFS += -DSPACE_CADET_ENABLE
359endif
diff --git a/docs/_summary.md b/docs/_summary.md
index c9d6c2bb1..d31087019 100644
--- a/docs/_summary.md
+++ b/docs/_summary.md
@@ -68,8 +68,7 @@
68 * [PS/2 Mouse](feature_ps2_mouse.md) 68 * [PS/2 Mouse](feature_ps2_mouse.md)
69 * [RGB Lighting](feature_rgblight.md) 69 * [RGB Lighting](feature_rgblight.md)
70 * [RGB Matrix](feature_rgb_matrix.md) 70 * [RGB Matrix](feature_rgb_matrix.md)
71 * [Space Cadet Shift](feature_space_cadet_shift.md) 71 * [Space Cadet](feature_space_cadet.md)
72 * [Space Cadet Shift Enter](feature_space_cadet_shift_enter.md)
73 * [Stenography](feature_stenography.md) 72 * [Stenography](feature_stenography.md)
74 * [Swap Hands](feature_swap_hands.md) 73 * [Swap Hands](feature_swap_hands.md)
75 * [Tap Dance](feature_tap_dance.md) 74 * [Tap Dance](feature_tap_dance.md)
diff --git a/docs/feature_space_cadet.md b/docs/feature_space_cadet.md
new file mode 100644
index 000000000..3e4665cde
--- /dev/null
+++ b/docs/feature_space_cadet.md
@@ -0,0 +1,59 @@
1# Space Cadet: The Future, Built In
2
3Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds, and now even cooler supporting Control and Alt as well!
4
5## Usage
6
7Firstly, in your keymap, do one of the following:
8- Replace the Left Shift key with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close).
9- Replace the Left Control key with `KC_LCPO` (Left Control, Parenthesis Open), and Right Control with `KC_RCPC` (Right Control, Parenthesis Close).
10- Replace the Left Alt key with `KC_LAPO` (Left Alt, Parenthesis Open), and Right Alt with `KC_RAPC` (Right Alt, Parenthesis Close).
11- Replace any Shift key in your keymap with `KC_SFTENT` (Right Shift, Enter).
12
13## Keycodes
14
15|Keycode |Description |
16|-----------|-------------------------------------------|
17|`KC_LSPO` |Left Shift when held, `(` when tapped |
18|`KC_RSPC` |Right Shift when held, `)` when tapped |
19|`KC_LCPO` |Left Control when held, `(` when tapped |
20|`KC_RCPC` |Right Control when held, `)` when tapped |
21|`KC_LAPO` |Left Alt when held, `(` when tapped |
22|`KC_RAPC` |Right Alt when held, `)` when tapped |
23|`KC_SFTENT`|Right Shift when held, `Enter` when tapped |
24
25## Caveats
26
27Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. See the [Command feature](feature_command.md) for info on how to change it, or make sure that Command is disabled in your `rules.mk` with:
28
29```make
30COMMAND_ENABLE = no
31```
32
33## Configuration
34
35By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`. In addition, you can redefine the modifier to send on tap, or even send no modifier at all. The new configuration defines bundle all options up into a single define of 3 key codes in this order: the `Modifier` when held or when used with other keys, the `Tap Modifer` sent when tapped (no modifier if `KC_TRNS`), finally the `Keycode` sent when tapped. Now keep in mind, mods from other keys will still apply to the `Keycode` if say `KC_RSFT` is held while tapping `KC_LSPO` key with `KC_TRNS` as the `Tap Modifer`.
36
37|Define |Default |Description |
38|----------------|-------------------------------|---------------------------------------------------------------------------------|
39|`LSPO_KEYS` |`KC_LSFT, LSPO_MOD, LSPO_KEY` |Send `KC_LSFT` when held, the mod and key defined by `LSPO_MOD` and `LSPO_KEY`. |
40|`RSPC_KEYS` |`KC_RSFT, RSPC_MOD, RSPC_KEY` |Send `KC_RSFT` when held, the mod and key defined by `RSPC_MOD` and `RSPC_KEY`. |
41|`LCPO_KEYS` |`KC_LCTL, KC_LCTL, KC_9` |Send `KC_LCTL` when held, the mod `KC_LCTL` with the key `KC_9` when tapped. |
42|`RCPO_KEYS` |`KC_RCTL, KC_RCTL, KC_0` |Send `KC_RCTL` when held, the mod `KC_RCTL` with the key `KC_0` when tapped. |
43|`LAPO_KEYS` |`KC_LALT, KC_LALT, KC_9` |Send `KC_LALT` when held, the mod `KC_LALT` with the key `KC_9` when tapped. |
44|`RAPO_KEYS` |`KC_RALT, KC_RALT, KC_0` |Send `KC_RALT` when held, the mod `KC_RALT` with the key `KC_0` when tapped. |
45|`SFTENT_KEYS` |`KC_RSFT, KC_TRNS, SFTENT_KEY` |Send `KC_RSFT` when held, no mod with the key `SFTENT_KEY` when tapped. |
46
47
48## Obsolete Configuration
49
50These defines are used in the above defines internally to support backwards compatibility, so you may continue to use them, however the above defines open up a larger range of flexibility than before. As an example, say you want to not send any modifier when you tap just `KC_LSPO`, with the old defines you had an all or nothing choice of using the `DISABLE_SPACE_CADET_MODIFIER` define. Now you can define that key as: `#define KC_LSPO_KEYS KC_LSFT, KC_TRNS, KC_9`. This tells the system to set Left Shift if held or used with other keys, then on tap send no modifier (transparent) with the `KC_9`
51
52|Define |Default |Description |
53|------------------------------|-------------|------------------------------------------------------------------|
54|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped |
55|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped |
56|`LSPO_MOD` |`KC_LSFT` |The modifier to apply to `LSPO_KEY` |
57|`RSPC_MOD` |`KC_RSFT` |The modifier to apply to `RSPC_KEY` |
58|`SFTENT_KEY` |`KC_ENT` |The keycode to send when the Shift key is tapped |
59|`DISABLE_SPACE_CADET_MODIFIER`|*Not defined*|If defined, prevent the Space Cadet from applying a modifier |
diff --git a/docs/feature_space_cadet_shift.md b/docs/feature_space_cadet_shift.md
deleted file mode 100644
index 427d2a581..000000000
--- a/docs/feature_space_cadet_shift.md
+++ /dev/null
@@ -1,37 +0,0 @@
1# Space Cadet Shift: The Future, Built In
2
3Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds.
4
5## Usage
6
7Replace the Left Shift key in your keymap with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close).
8
9## Keycodes
10
11|Keycode |Description |
12|---------|--------------------------------------|
13|`KC_LSPO`|Left Shift when held, `(` when tapped |
14|`KC_RSPC`|Right Shift when held, `)` when tapped|
15
16## Caveats
17
18Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. Make sure that Command is disabled in your `rules.mk` with:
19
20```make
21COMMAND_ENABLE = no
22```
23
24## Configuration
25
26By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`.
27You can also disable the rollover, allowing you to use the opposite Shift key to cancel the Space Cadet state in the event of an erroneous press, instead of emitting a pair of parentheses when the keys are released.
28Also, by default, the Space Cadet applies modifiers LSPO_MOD and RSPC_MOD to keys defined by LSPO_KEY and RSPC_KEY. You can override this behavior by redefining those variables in your `config.h`. You can also prevent the Space Cadet to apply a modifier by defining DISABLE_SPACE_CADET_MODIFIER in your `config.h`.
29
30|Define |Default |Description |
31|------------------------------|-------------|--------------------------------------------------------------------------------|
32|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped |
33|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped |
34|`LSPO_MOD` |`KC_LSFT` |The keycode to send when Left Shift is tapped |
35|`RSPC_MOD` |`KC_RSFT` |The keycode to send when Right Shift is tapped |
36|`DISABLE_SPACE_CADET_ROLLOVER`|*Not defined*|If defined, use the opposite Shift key to cancel Space Cadet |
37|`DISABLE_SPACE_CADET_MODIFIER`|*Not defined*|If defined, prevent the Space Cadet to apply a modifier to LSPO_KEY and RSPC_KEY|
diff --git a/docs/feature_space_cadet_shift_enter.md b/docs/feature_space_cadet_shift_enter.md
deleted file mode 100644
index 56a569b13..000000000
--- a/docs/feature_space_cadet_shift_enter.md
+++ /dev/null
@@ -1,31 +0,0 @@
1# Space Cadet Shift Enter
2
3Based on the [Space Cadet Shift](feature_space_cadet_shift.md) feature. Tap the Shift key on its own, and it behaves like Enter. When held, the Shift functions as normal.
4
5## Usage
6
7Replace any Shift key in your keymap with `KC_SFTENT` (Shift, Enter), and you're done.
8
9## Keycodes
10
11|Keycode |Description |
12|-----------|----------------------------------------|
13|`KC_SFTENT`|Right Shift when held, Enter when tapped|
14
15## Caveats
16
17As with Space Cadet Shift, this feature may conflict with Command, so it should be disabled in your `rules.mk` with:
18
19```make
20COMMAND_ENABLE = no
21```
22
23This feature also uses the same timers as Space Cadet Shift, so using them in tandem may produce strange results.
24
25## Configuration
26
27By default Space Cadet assumes a US ANSI layout, but if you'd like to use a different key for Enter, you can redefine it in your `config.h`:
28
29|Define |Default |Description |
30|------------|--------|------------------------------------------------|
31|`SFTENT_KEY`|`KC_ENT`|The keycode to send when the Shift key is tapped|
diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c
new file mode 100644
index 000000000..a9c506168
--- /dev/null
+++ b/quantum/process_keycode/process_space_cadet.c
@@ -0,0 +1,146 @@
1/* Copyright 2019 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "process_space_cadet.h"
17
18#ifndef TAPPING_TERM
19 #define TAPPING_TERM 200
20#endif
21
22// ********** OBSOLETE DEFINES, STOP USING! (pls?) **********
23// Shift / paren setup
24#ifndef LSPO_KEY
25 #define LSPO_KEY KC_9
26#endif
27#ifndef RSPC_KEY
28 #define RSPC_KEY KC_0
29#endif
30
31// Shift / Enter setup
32#ifndef SFTENT_KEY
33 #define SFTENT_KEY KC_ENT
34#endif
35
36#ifdef DISABLE_SPACE_CADET_MODIFIER
37 #ifndef LSPO_MOD
38 #define LSPO_MOD KC_TRNS
39 #endif
40 #ifndef RSPC_MOD
41 #define RSPC_MOD KC_TRNS
42 #endif
43#else
44 #ifndef LSPO_MOD
45 #define LSPO_MOD KC_LSFT
46 #endif
47 #ifndef RSPC_MOD
48 #define RSPC_MOD KC_RSFT
49 #endif
50#endif
51// **********************************************************
52
53// Shift / paren setup
54#ifndef LSPO_KEYS
55 #define LSPO_KEYS KC_LSFT, LSPO_MOD, LSPO_KEY
56#endif
57#ifndef RSPC_KEYS
58 #define RSPC_KEYS KC_RSFT, RSPC_MOD, RSPC_KEY
59#endif
60
61// Control / paren setup
62#ifndef LCPO_KEYS
63 #define LCPO_KEYS KC_LCTL, KC_LCTL, KC_9
64#endif
65#ifndef RCPO_KEYS
66 #define RCPO_KEYS KC_RCTL, KC_RCTL, KC_0
67#endif
68
69// Alt / paren setup
70#ifndef LAPO_KEYS
71 #define LAPO_KEYS KC_LALT, KC_LALT, KC_9
72#endif
73#ifndef RAPO_KEYS
74 #define RAPO_KEYS KC_RALT, KC_RALT, KC_0
75#endif
76
77// Shift / Enter setup
78#ifndef SFTENT_KEYS
79 #define SFTENT_KEYS KC_RSFT, KC_TRNS, SFTENT_KEY
80#endif
81
82static uint8_t sc_last = 0;
83static uint16_t sc_timer = 0;
84
85void perform_space_cadet(keyrecord_t *record, uint8_t normalMod, uint8_t tapMod, uint8_t keycode) {
86 if (record->event.pressed) {
87 sc_last = normalMod;
88 sc_timer = timer_read ();
89 if (IS_MOD(normalMod)) {
90 register_mods(MOD_BIT(normalMod));
91 }
92 }
93 else {
94 if (IS_MOD(normalMod)) {
95 unregister_mods(MOD_BIT(normalMod));
96 }
97
98 if (sc_last == normalMod && timer_elapsed(sc_timer) < TAPPING_TERM) {
99 if (IS_MOD(tapMod)) {
100 register_mods(MOD_BIT(tapMod));
101 }
102 tap_code(keycode);
103 if (IS_MOD(tapMod)) {
104 unregister_mods(MOD_BIT(tapMod));
105 }
106 }
107 }
108}
109
110bool process_space_cadet(uint16_t keycode, keyrecord_t *record) {
111 switch(keycode) {
112 case KC_LSPO: {
113 perform_space_cadet(record, LSPO_KEYS);
114 return false;
115 }
116 case KC_RSPC: {
117 perform_space_cadet(record, RSPC_KEYS);
118 return false;
119 }
120 case KC_LCPO: {
121 perform_space_cadet(record, LCPO_KEYS);
122 return false;
123 }
124 case KC_RCPC: {
125 perform_space_cadet(record, RCPO_KEYS);
126 return false;
127 }
128 case KC_LAPO: {
129 perform_space_cadet(record, LAPO_KEYS);
130 return false;
131 }
132 case KC_RAPC: {
133 perform_space_cadet(record, RAPO_KEYS);
134 return false;
135 }
136 case KC_SFTENT: {
137 perform_space_cadet(record, SFTENT_KEYS);
138 return false;
139 }
140 default: {
141 sc_last = 0;
142 break;
143 }
144 }
145 return true;
146}
diff --git a/quantum/process_keycode/process_space_cadet.h b/quantum/process_keycode/process_space_cadet.h
new file mode 100644
index 000000000..3f08b8002
--- /dev/null
+++ b/quantum/process_keycode/process_space_cadet.h
@@ -0,0 +1,21 @@
1/* Copyright 2019 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "quantum.h"
19
20void perform_space_cadet(keyrecord_t *record, uint8_t normalMod, uint8_t tapMod, uint8_t keycode);
21bool process_space_cadet(uint16_t keycode, keyrecord_t *record);
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 0fb798a74..fcedf0bc1 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -24,10 +24,6 @@
24#include "outputselect.h" 24#include "outputselect.h"
25#endif 25#endif
26 26
27#ifndef TAPPING_TERM
28#define TAPPING_TERM 200
29#endif
30
31#ifndef BREATHING_PERIOD 27#ifndef BREATHING_PERIOD
32#define BREATHING_PERIOD 6 28#define BREATHING_PERIOD 6
33#endif 29#endif
@@ -196,30 +192,6 @@ void reset_keyboard(void) {
196 bootloader_jump(); 192 bootloader_jump();
197} 193}
198 194
199// Shift / paren setup
200
201#ifndef LSPO_KEY
202 #define LSPO_KEY KC_9
203#endif
204#ifndef RSPC_KEY
205 #define RSPC_KEY KC_0
206#endif
207
208#ifndef LSPO_MOD
209 #define LSPO_MOD KC_LSFT
210#endif
211#ifndef RSPC_MOD
212 #define RSPC_MOD KC_RSFT
213#endif
214
215// Shift / Enter setup
216#ifndef SFTENT_KEY
217 #define SFTENT_KEY KC_ENT
218#endif
219
220static bool shift_interrupted[2] = {0, 0};
221static uint16_t scs_timer[2] = {0, 0};
222
223/* true if the last press of GRAVE_ESC was shifted (i.e. GUI or SHIFT were pressed), false otherwise. 195/* true if the last press of GRAVE_ESC was shifted (i.e. GUI or SHIFT were pressed), false otherwise.
224 * Used to ensure that the correct keycode is released if the key is released. 196 * Used to ensure that the correct keycode is released if the key is released.
225 */ 197 */
@@ -329,6 +301,9 @@ bool process_record_quantum(keyrecord_t *record) {
329 #ifdef TERMINAL_ENABLE 301 #ifdef TERMINAL_ENABLE
330 process_terminal(keycode, record) && 302 process_terminal(keycode, record) &&
331 #endif 303 #endif
304 #ifdef SPACE_CADET_ENABLE
305 process_space_cadet(keycode, record) &&
306 #endif
332 true)) { 307 true)) {
333 return false; 308 return false;
334 } 309 }
@@ -685,92 +660,6 @@ bool process_record_quantum(keyrecord_t *record) {
685 return false; 660 return false;
686 } 661 }
687 break; 662 break;
688 case KC_LSPO: {
689 if (record->event.pressed) {
690 shift_interrupted[0] = false;
691 scs_timer[0] = timer_read ();
692 register_mods(MOD_BIT(KC_LSFT));
693 }
694 else {
695 #ifdef DISABLE_SPACE_CADET_ROLLOVER
696 if (get_mods() & MOD_BIT(RSPC_MOD)) {
697 shift_interrupted[0] = true;
698 shift_interrupted[1] = true;
699 }
700 #endif
701 if (!shift_interrupted[0] && timer_elapsed(scs_timer[0]) < TAPPING_TERM) {
702 #ifdef DISABLE_SPACE_CADET_MODIFIER
703 unregister_mods(MOD_BIT(KC_LSFT));
704 #else
705 if( LSPO_MOD != KC_LSFT ){
706 unregister_mods(MOD_BIT(KC_LSFT));
707 register_mods(MOD_BIT(LSPO_MOD));
708 }
709 #endif
710 register_code(LSPO_KEY);
711 unregister_code(LSPO_KEY);
712 #ifndef DISABLE_SPACE_CADET_MODIFIER
713 if( LSPO_MOD != KC_LSFT ){
714 unregister_mods(MOD_BIT(LSPO_MOD));
715 }
716 #endif
717 }
718 unregister_mods(MOD_BIT(KC_LSFT));
719 }
720 return false;
721 }
722
723 case KC_RSPC: {
724 if (record->event.pressed) {
725 shift_interrupted[1] = false;
726 scs_timer[1] = timer_read ();
727 register_mods(MOD_BIT(KC_RSFT));
728 }
729 else {
730 #ifdef DISABLE_SPACE_CADET_ROLLOVER
731 if (get_mods() & MOD_BIT(LSPO_MOD)) {
732 shift_interrupted[0] = true;
733 shift_interrupted[1] = true;
734 }
735 #endif
736 if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) {
737 #ifdef DISABLE_SPACE_CADET_MODIFIER
738 unregister_mods(MOD_BIT(KC_RSFT));
739 #else
740 if( RSPC_MOD != KC_RSFT ){
741 unregister_mods(MOD_BIT(KC_RSFT));
742 register_mods(MOD_BIT(RSPC_MOD));
743 }
744 #endif
745 register_code(RSPC_KEY);
746 unregister_code(RSPC_KEY);
747 #ifndef DISABLE_SPACE_CADET_MODIFIER
748 if ( RSPC_MOD != KC_RSFT ){
749 unregister_mods(MOD_BIT(RSPC_MOD));
750 }
751 #endif
752 }
753 unregister_mods(MOD_BIT(KC_RSFT));
754 }
755 return false;
756 }
757
758 case KC_SFTENT: {
759 if (record->event.pressed) {
760 shift_interrupted[1] = false;
761 scs_timer[1] = timer_read ();
762 register_mods(MOD_BIT(KC_RSFT));
763 }
764 else if (!shift_interrupted[1] && timer_elapsed(scs_timer[1]) < TAPPING_TERM) {
765 unregister_mods(MOD_BIT(KC_RSFT));
766 register_code(SFTENT_KEY);
767 unregister_code(SFTENT_KEY);
768 }
769 else {
770 unregister_mods(MOD_BIT(KC_RSFT));
771 }
772 return false;
773 }
774 663
775 case GRAVE_ESC: { 664 case GRAVE_ESC: {
776 uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT) 665 uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)
@@ -825,12 +714,6 @@ bool process_record_quantum(keyrecord_t *record) {
825 return false; 714 return false;
826 } 715 }
827#endif 716#endif
828
829 default: {
830 shift_interrupted[0] = true;
831 shift_interrupted[1] = true;
832 break;
833 }
834 } 717 }
835 718
836 return process_action_kb(record); 719 return process_action_kb(record);
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 17cb90274..208268df6 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -131,6 +131,10 @@ extern uint32_t default_layer_state;
131 #include "process_terminal_nop.h" 131 #include "process_terminal_nop.h"
132#endif 132#endif
133 133
134#ifdef SPACE_CADET_ENABLE
135 #include "process_space_cadet.h"
136#endif
137
134#ifdef HD44780_ENABLE 138#ifdef HD44780_ENABLE
135 #include "hd44780.h" 139 #include "hd44780.h"
136#endif 140#endif
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index fe2e3510d..19bd7c216 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -475,6 +475,18 @@ enum quantum_keycodes {
475 HPT_DWLI, 475 HPT_DWLI,
476 HPT_DWLD, 476 HPT_DWLD,
477 477
478 // Left control, open paren
479 KC_LCPO,
480
481 // Right control, close paren
482 KC_RCPC,
483
484 // Left control, open paren
485 KC_LAPO,
486
487 // Right control, close paren
488 KC_RAPC,
489
478 // always leave at the end 490 // always leave at the end
479 SAFE_RANGE 491 SAFE_RANGE
480}; 492};