summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorPaul Landers <paul@thelanders.family>2024-01-09 06:07:10 -0500
committerGitHub <noreply@github.com>2024-01-09 22:07:10 +1100
commit1f6dfd19cf93b365c6ad5227d2a8a054ff30cc24 (patch)
treef78a11e550a2dc88497920e29abdb97534c376c1 /quantum
parent8b48f0dea36c192a1a98a2ead3b72412e23d08d6 (diff)
Ignore space cadet key release when caps word is active (#21721)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/process_keycode/process_caps_word.c4
-rw-r--r--quantum/process_keycode/process_space_cadet.c6
-rw-r--r--quantum/process_keycode/process_space_cadet.h1
3 files changed, 10 insertions, 1 deletions
diff --git a/quantum/process_keycode/process_caps_word.c b/quantum/process_keycode/process_caps_word.c
index 1088c8f76c..b8fb868c6d 100644
--- a/quantum/process_keycode/process_caps_word.c
+++ b/quantum/process_keycode/process_caps_word.c
@@ -14,6 +14,7 @@
#include "process_caps_word.h"
#include "process_auto_shift.h"
+#include "process_space_cadet.h"
#include "caps_word.h"
#include "keycodes.h"
#include "quantum_keycodes.h"
@@ -110,6 +111,9 @@ bool process_caps_word(uint16_t keycode, keyrecord_t* record) {
# endif // COMMAND_ENABLE
) {
caps_word_on();
+# ifdef SPACE_CADET_ENABLE
+ reset_space_cadet();
+# endif // SPACE_CADET_ENABLE
}
# endif // defined(COMMAND_ENABLE) && !defined(IS_COMMAND)
#endif // BOTH_SHIFTS_TURNS_ON_CAPS_WORD
diff --git a/quantum/process_keycode/process_space_cadet.c b/quantum/process_keycode/process_space_cadet.c
index f948ad6238..3e280d57d9 100644
--- a/quantum/process_keycode/process_space_cadet.c
+++ b/quantum/process_keycode/process_space_cadet.c
@@ -157,10 +157,14 @@ bool process_space_cadet(uint16_t keycode, keyrecord_t *record) {
}
default: {
if (record->event.pressed) {
- sc_last = 0;
+ reset_space_cadet();
}
break;
}
}
return true;
}
+
+void reset_space_cadet() {
+ sc_last = 0;
+}
diff --git a/quantum/process_keycode/process_space_cadet.h b/quantum/process_keycode/process_space_cadet.h
index 6d10051532..9d254e26fd 100644
--- a/quantum/process_keycode/process_space_cadet.h
+++ b/quantum/process_keycode/process_space_cadet.h
@@ -21,3 +21,4 @@
void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdMod, uint8_t tapMod, uint8_t keycode);
bool process_space_cadet(uint16_t keycode, keyrecord_t *record);
+void reset_space_cadet(void);