summaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_space_cadet.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_space_cadet.c')
-rw-r--r--quantum/process_keycode/process_space_cadet.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c
index ac39df8089..c8721d446c 100644
--- a/quantum/process_keycode/process_space_cadet.c
+++ b/quantum/process_keycode/process_space_cadet.c
@@ -60,18 +60,18 @@
// Control / paren setup
#ifndef LCPO_KEYS
- #define LCPO_KEYS KC_LCTL, KC_LCTL, KC_9
+ #define LCPO_KEYS KC_LCTL, KC_LSFT, KC_9
#endif
#ifndef RCPC_KEYS
- #define RCPC_KEYS KC_RCTL, KC_RCTL, KC_0
+ #define RCPC_KEYS KC_RCTL, KC_RSFT, KC_0
#endif
// Alt / paren setup
#ifndef LAPO_KEYS
- #define LAPO_KEYS KC_LALT, KC_LALT, KC_9
+ #define LAPO_KEYS KC_LALT, KC_LSFT, KC_9
#endif
#ifndef RAPC_KEYS
- #define RAPC_KEYS KC_RALT, KC_RALT, KC_0
+ #define RAPC_KEYS KC_RALT, KC_RSFT, KC_0
#endif
// Shift / Enter setup
@@ -81,11 +81,17 @@
static uint8_t sc_last = 0;
static uint16_t sc_timer = 0;
+#ifdef SPACE_CADET_MODIFIER_CARRYOVER
+static uint8_t sc_mods = 0;
+#endif
void perform_space_cadet(keyrecord_t *record, uint8_t holdMod, uint8_t tapMod, uint8_t keycode) {
if (record->event.pressed) {
sc_last = holdMod;
sc_timer = timer_read ();
+#ifdef SPACE_CADET_MODIFIER_CARRYOVER
+ sc_mods = get_mods();
+#endif
if (IS_MOD(holdMod)) {
register_mods(MOD_BIT(holdMod));
}
@@ -100,7 +106,13 @@ void perform_space_cadet(keyrecord_t *record, uint8_t holdMod, uint8_t tapMod, u
register_mods(MOD_BIT(tapMod));
}
}
+#ifdef SPACE_CADET_MODIFIER_CARRYOVER
+ set_weak_mods(sc_mods);
+#endif
tap_code(keycode);
+#ifdef SPACE_CADET_MODIFIER_CARRYOVER
+ clear_weak_mods();
+#endif
if (IS_MOD(tapMod)) {
unregister_mods(MOD_BIT(tapMod));
}
@@ -143,7 +155,9 @@ bool process_space_cadet(uint16_t keycode, keyrecord_t *record) {
return false;
}
default: {
- sc_last = 0;
+ if (record->event.pressed) {
+ sc_last = 0;
+ }
break;
}
}