Browse Source

Ignore space cadet key release when caps word is active (#21721)

pull/22872/head
Paul Landers 3 months ago
committed by GitHub
parent
commit
1f6dfd19cf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 4 deletions
  1. +4
    -0
      quantum/process_keycode/process_caps_word.c
  2. +5
    -1
      quantum/process_keycode/process_space_cadet.c
  3. +1
    -0
      quantum/process_keycode/process_space_cadet.h
  4. +3
    -3
      tests/caps_word/test_caps_word.cpp

+ 4
- 0
quantum/process_keycode/process_caps_word.c View File

@ -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


+ 5
- 1
quantum/process_keycode/process_space_cadet.c View File

@ -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;
}

+ 1
- 0
quantum/process_keycode/process_space_cadet.h View File

@ -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);

+ 3
- 3
tests/caps_word/test_caps_word.cpp View File

@ -423,8 +423,8 @@ TEST_P(CapsWordBothShifts, PressLRLR) {
run_one_scan_loop();
right_shift.press();
// For mod-tap and Space Cadet keys, wait for the tapping term.
if (left_shift.code == LSFT_T(KC_A) || left_shift.code == QK_SPACE_CADET_LEFT_SHIFT_PARENTHESIS_OPEN) {
// For mod-tap, wait for the tapping term.
if (left_shift.code == LSFT_T(KC_A)) {
idle_for(TAPPING_TERM);
}
@ -461,7 +461,7 @@ TEST_P(CapsWordBothShifts, PressLRRL) {
run_one_scan_loop();
right_shift.press();
if (left_shift.code == LSFT_T(KC_A) || left_shift.code == QK_SPACE_CADET_LEFT_SHIFT_PARENTHESIS_OPEN) {
if (left_shift.code == LSFT_T(KC_A)) {
idle_for(TAPPING_TERM);
}
run_one_scan_loop();


Loading…
Cancel
Save