Skip to content

Commit 900ca86

Browse files
IsaacElenbaaschristrotter
authored andcommitted
Improve test invocation, fix Retro Shift bugs, and add Auto+Retro Shift test cases (qmk#15889)
1 parent 4b81c9f commit 900ca86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2584
-89
lines changed

Makefile

+17-9
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,18 @@ endef
300300
define BUILD_TEST
301301
TEST_PATH := $1
302302
TEST_NAME := $$(notdir $$(TEST_PATH))
303+
TEST_FULL_NAME := $$(subst /,_,$$(patsubst $$(ROOT_DIR)tests/%,%,$$(TEST_PATH)))
303304
MAKE_TARGET := $2
304305
COMMAND := $1
305306
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f $(BUILDDEFS_PATH)/build_test.mk $$(MAKE_TARGET)
306-
MAKE_VARS := TEST=$$(TEST_NAME) TEST_PATH=$$(TEST_PATH) FULL_TESTS="$$(FULL_TESTS)"
307+
MAKE_VARS := TEST=$$(TEST_NAME) TEST_OUTPUT=$$(TEST_FULL_NAME) TEST_PATH=$$(TEST_PATH) FULL_TESTS="$$(FULL_TESTS)"
307308
MAKE_MSG := $$(MSG_MAKE_TEST)
308309
$$(eval $$(call BUILD))
309310
ifneq ($$(MAKE_TARGET),clean)
310-
TEST_EXECUTABLE := $$(TEST_OUTPUT_DIR)/$$(TEST_NAME).elf
311-
TESTS += $$(TEST_NAME)
311+
TEST_EXECUTABLE := $$(TEST_OUTPUT_DIR)/$$(TEST_FULL_NAME).elf
312+
TESTS += $$(TEST_FULL_NAME)
312313
TEST_MSG := $$(MSG_TEST)
313-
$$(TEST_NAME)_COMMAND := \
314+
$$(TEST_FULL_NAME)_COMMAND := \
314315
printf "$$(TEST_MSG)\n"; \
315316
$$(TEST_EXECUTABLE); \
316317
if [ $$$$? -gt 0 ]; \
@@ -322,15 +323,22 @@ endef
322323

323324
define PARSE_TEST
324325
TESTS :=
325-
TEST_NAME := $$(firstword $$(subst :, ,$$(RULE)))
326-
TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME):,,$$(RULE)))
326+
# list of possible targets, colon-delimited, to reassign to MAKE_TARGET and remove
327+
TARGETS := :clean:
328+
ifneq (,$$(findstring :$$(lastword $$(subst :, ,$$(RULE))):, $$(TARGETS)))
329+
MAKE_TARGET := $$(lastword $$(subst :, ,$$(RULE)))
330+
TEST_SUBPATH := $$(subst $$(eval) ,/,$$(wordlist 2, $$(words $$(subst :, ,$$(RULE))), _ $$(subst :, ,$$(RULE))))
331+
else
332+
MAKE_TARGET :=
333+
TEST_SUBPATH := $$(subst :,/,$$(RULE))
334+
endif
327335
include $(BUILDDEFS_PATH)/testlist.mk
328-
ifeq ($$(TEST_NAME),all)
336+
ifeq ($$(RULE),all)
329337
MATCHED_TESTS := $$(TEST_LIST)
330338
else
331-
MATCHED_TESTS := $$(foreach TEST, $$(TEST_LIST),$$(if $$(findstring x$$(TEST_NAME)x, x$$(notdir $$(TEST))x), $$(TEST),))
339+
MATCHED_TESTS := $$(foreach TEST, $$(TEST_LIST),$$(if $$(findstring /$$(TEST_SUBPATH)/, $$(patsubst %,%/,$$(TEST))), $$(TEST),))
332340
endif
333-
$$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET))))
341+
$$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(MAKE_TARGET))))
334342
endef
335343

336344

builddefs/build_full_test.mk

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
# You should have received a copy of the GNU General Public License
1414
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515

16-
$(TEST)_INC := \
16+
$(TEST_OUTPUT)_INC := \
1717
tests/test_common/common_config.h
1818

19-
$(TEST)_SRC := \
19+
$(TEST_OUTPUT)_SRC := \
2020
$(QUANTUM_SRC) \
2121
$(SRC) \
2222
$(QUANTUM_PATH)/keymap_introspection.c \
@@ -30,8 +30,8 @@ $(TEST)_SRC := \
3030
tests/test_common/test_logger.cpp \
3131
$(patsubst $(ROOTDIR)/%,%,$(wildcard $(TEST_PATH)/*.cpp))
3232

33-
$(TEST)_DEFS := $(OPT_DEFS) "-DKEYMAP_C=\"keymap.c\""
33+
$(TEST_OUTPUT)_DEFS := $(OPT_DEFS) "-DKEYMAP_C=\"keymap.c\""
3434

35-
$(TEST)_CONFIG := $(TEST_PATH)/config.h
35+
$(TEST_OUTPUT)_CONFIG := $(TEST_PATH)/config.h
3636

3737
VPATH += $(TOP_DIR)/tests/test_common

builddefs/build_test.mk

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ OPT = g
99
include paths.mk
1010
include $(BUILDDEFS_PATH)/message.mk
1111

12-
TARGET=test/$(TEST)
12+
TARGET=test/$(TEST_OUTPUT)
1313

1414
GTEST_OUTPUT = $(BUILD_DIR)/gtest
1515

1616
TEST_OBJ = $(BUILD_DIR)/test_obj
1717

18-
OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT)
18+
OUTPUTS := $(TEST_OBJ)/$(TEST_OUTPUT) $(GTEST_OUTPUT)
1919

2020
GTEST_INC := \
2121
$(LIB_PATH)/googletest/googletest/include \
@@ -71,18 +71,18 @@ ifneq ($(filter $(FULL_TESTS),$(TEST)),)
7171
include $(BUILDDEFS_PATH)/build_full_test.mk
7272
endif
7373

74-
$(TEST)_SRC += \
74+
$(TEST_OUTPUT)_SRC += \
7575
tests/test_common/main.cpp \
7676
$(QUANTUM_PATH)/logging/print.c
7777

7878
ifneq ($(strip $(INTROSPECTION_KEYMAP_C)),)
79-
$(TEST)_DEFS += -DINTROSPECTION_KEYMAP_C=\"$(strip $(INTROSPECTION_KEYMAP_C))\"
79+
$(TEST_OUTPUT)_DEFS += -DINTROSPECTION_KEYMAP_C=\"$(strip $(INTROSPECTION_KEYMAP_C))\"
8080
endif
8181

82-
$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
83-
$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
84-
$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
85-
$(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG)
82+
$(TEST_OBJ)/$(TEST_OUTPUT)_SRC := $($(TEST_OUTPUT)_SRC)
83+
$(TEST_OBJ)/$(TEST_OUTPUT)_INC := $($(TEST_OUTPUT)_INC) $(VPATH) $(GTEST_INC)
84+
$(TEST_OBJ)/$(TEST_OUTPUT)_DEFS := $($(TEST_OUTPUT)_DEFS)
85+
$(TEST_OBJ)/$(TEST_OUTPUT)_CONFIG := $($(TEST_OUTPUT)_CONFIG)
8686

8787
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
8888
include $(BUILDDEFS_PATH)/common_rules.mk

docs/feature_auto_shift.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,18 @@ For more granular control, there is `get_auto_shifted_key`. The default function
180180
bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
181181
switch (keycode) {
182182
# ifndef NO_AUTO_SHIFT_ALPHA
183-
case KC_A ... KC_Z:
183+
case AUTO_SHIFT_ALPHA:
184184
# endif
185185
# ifndef NO_AUTO_SHIFT_NUMERIC
186-
case KC_1 ... KC_0:
186+
case AUTO_SHIFT_NUMERIC:
187187
# endif
188188
# ifndef NO_AUTO_SHIFT_SPECIAL
189-
# ifndef NO_AUTO_SHIFT_TAB
189+
# ifndef NO_AUTO_SHIFT_TAB
190190
case KC_TAB:
191-
# endif
192-
# ifndef NO_AUTO_SHIFT_SYMBOLS
191+
# endif
192+
# ifndef NO_AUTO_SHIFT_SYMBOLS
193193
case AUTO_SHIFT_SYMBOLS:
194-
# endif
194+
# endif
195195
# endif
196196
# ifdef AUTO_SHIFT_ENTER
197197
case KC_ENT:
@@ -310,10 +310,16 @@ generating taps on release. For example:
310310
#define RETRO_SHIFT 500
311311
```
312312
313+
Without a value set, holds of any length without an interrupting key will produce the shifted value.
314+
313315
This value (if set) must be greater than one's `TAPPING_TERM`, as the key press
314316
must be designated as a 'hold' by `process_tapping` before we send the modifier.
317+
[Per-key tapping terms](tap_hold.md#tapping-term) can be used as a workaround.
315318
There is no such limitation in regards to `AUTO_SHIFT_TIMEOUT` for normal keys.
316319
320+
**Note:** Tap Holds must be added to Auto Shift, see [here.](feature_auto_shift.md#auto-shift-per-key)
321+
`IS_RETRO` may be helpful if one wants all Tap Holds retro shifted.
322+
317323
### Retro Shift and Tap Hold Configurations
318324
319325
Tap Hold Configurations work a little differently when using Retro Shift.

docs/unit_testing.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ Note how there's several different tests, each mocking out a separate part. Also
3636

3737
## Running the Tests
3838

39-
To run all the tests in the codebase, type `make test:all`. You can also run test matching a substring by typing `make test:matchingsubstring` Note that the tests are always compiled with the native compiler of your platform, so they are also run like any other program on your computer.
39+
To run all the tests in the codebase, type `make test:all`. You can also run test matching a substring by typing `make test:matchingsubstring`. `matchingsubstring` can contain colons to be more specific; `make test:tap_hold_configurations` will run the `tap_hold_configurations` tests for all features while `make test:retro_shift:tap_hold_configurations` will run the `tap_hold_configurations` tests for only the Retro Shift feature.
40+
41+
Note that the tests are always compiled with the native compiler of your platform, so they are also run like any other program on your computer.
4042

4143
## Debugging the Tests
4244

quantum/action.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ void process_action(keyrecord_t *record, action_t action) {
497497
default:
498498
if (event.pressed) {
499499
if (tap_count > 0) {
500-
# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
500+
# ifdef HOLD_ON_OTHER_KEY_PRESS
501501
if (
502502
# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
503503
get_hold_on_other_key_press(get_event_keycode(record->event, false), record) &&

quantum/action_tapping.c

+39-39
Original file line numberDiff line numberDiff line change
@@ -116,25 +116,26 @@ void action_tapping_process(keyrecord_t record) {
116116
* readable. The conditional definition of tapping_keycode and all the
117117
* conditional uses of it are hidden inside macros named TAP_...
118118
*/
119-
# if (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) || defined(PERMISSIVE_HOLD_PER_KEY) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY)
120-
# define TAP_DEFINE_KEYCODE const uint16_t tapping_keycode = get_record_keycode(&tapping_key, false)
121-
# else
122-
# define TAP_DEFINE_KEYCODE
123-
# endif
119+
# define TAP_DEFINE_KEYCODE const uint16_t tapping_keycode = get_record_keycode(&tapping_key, false)
124120

125121
# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)
126122
# ifdef RETRO_TAPPING_PER_KEY
127-
# define TAP_GET_RETRO_TAPPING get_retro_tapping(tapping_keycode, &tapping_key)
123+
# define TAP_GET_RETRO_TAPPING(keyp) get_auto_shifted_key(tapping_keycode, keyp) && get_retro_tapping(tapping_keycode, &tapping_key)
128124
# else
129-
# define TAP_GET_RETRO_TAPPING true
125+
# define TAP_GET_RETRO_TAPPING(keyp) get_auto_shifted_key(tapping_keycode, keyp)
130126
# endif
131-
# define MAYBE_RETRO_SHIFTING(ev) (TAP_GET_RETRO_TAPPING && (RETRO_SHIFT + 0) != 0 && TIMER_DIFF_16((ev).time, tapping_key.event.time) < (RETRO_SHIFT + 0))
127+
/* Used to extend TAPPING_TERM:
128+
* indefinitely if RETRO_SHIFT does not have a value
129+
* to RETRO_SHIFT if RETRO_SHIFT is set
130+
* for possibly retro shifted keys.
131+
*/
132+
# define MAYBE_RETRO_SHIFTING(ev, keyp) (get_auto_shifted_key(tapping_keycode, keyp) && TAP_GET_RETRO_TAPPING(keyp) && ((RETRO_SHIFT + 0) == 0 || TIMER_DIFF_16((ev).time, tapping_key.event.time) < (RETRO_SHIFT + 0)))
132133
# define TAP_IS_LT IS_QK_LAYER_TAP(tapping_keycode)
133134
# define TAP_IS_MT IS_QK_MOD_TAP(tapping_keycode)
134135
# define TAP_IS_RETRO IS_RETRO(tapping_keycode)
135136
# else
136-
# define TAP_GET_RETRO_TAPPING false
137-
# define MAYBE_RETRO_SHIFTING(ev) false
137+
# define TAP_GET_RETRO_TAPPING(keyp) false
138+
# define MAYBE_RETRO_SHIFTING(ev, kp) false
138139
# define TAP_IS_LT false
139140
# define TAP_IS_MT false
140141
# define TAP_IS_RETRO false
@@ -187,20 +188,19 @@ bool process_tapping(keyrecord_t *keyp) {
187188
return true;
188189
}
189190

191+
# if (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)) || defined(PERMISSIVE_HOLD_PER_KEY) || defined(HOLD_ON_OTHER_KEY_PRESS_PER_KEY)
190192
TAP_DEFINE_KEYCODE;
193+
# endif
191194

192195
// process "pressed" tapping key state
193196
if (tapping_key.event.pressed) {
194-
if (WITHIN_TAPPING_TERM(event) || MAYBE_RETRO_SHIFTING(event)) {
197+
if (WITHIN_TAPPING_TERM(event) || MAYBE_RETRO_SHIFTING(event, keyp)) {
195198
if (IS_NOEVENT(event)) {
196199
// early return for tick events
197200
return true;
198201
}
199202
if (tapping_key.tap.count == 0) {
200203
if (IS_TAPPING_RECORD(keyp) && !event.pressed) {
201-
# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)
202-
retroshift_swap_times();
203-
# endif
204204
// first tap!
205205
ac_dprintf("Tapping: First tap(0->1).\n");
206206
tapping_key.tap.count = 1;
@@ -218,28 +218,12 @@ bool process_tapping(keyrecord_t *keyp) {
218218
*/
219219
// clang-format off
220220
else if (
221+
!event.pressed && waiting_buffer_typed(event) &&
221222
(
222-
!event.pressed && waiting_buffer_typed(event) &&
223-
TAP_GET_PERMISSIVE_HOLD
224-
)
225-
// Causes nested taps to not wait past TAPPING_TERM/RETRO_SHIFT
226-
// unnecessarily and fixes them for Layer Taps.
227-
|| (TAP_GET_RETRO_TAPPING &&
228-
(
229-
// Rolled over the two keys.
230-
(tapping_key.tap.interrupted == true && (
231-
(TAP_IS_LT && TAP_GET_HOLD_ON_OTHER_KEY_PRESS) ||
232-
(TAP_IS_MT && TAP_GET_HOLD_ON_OTHER_KEY_PRESS)
233-
)
234-
)
235-
// Makes Retro Shift ignore the default behavior of
236-
// MTs and LTs on nested taps below TAPPING_TERM or RETRO_SHIFT
237-
|| (
238-
TAP_IS_RETRO
239-
&& (event.key.col != tapping_key.event.key.col || event.key.row != tapping_key.event.key.row)
240-
&& !event.pressed && waiting_buffer_typed(event)
241-
)
242-
)
223+
TAP_GET_PERMISSIVE_HOLD ||
224+
// Causes nested taps to not wait past TAPPING_TERM/RETRO_SHIFT
225+
// unnecessarily and fixes them for Layer Taps.
226+
TAP_GET_RETRO_TAPPING(keyp)
243227
)
244228
) {
245229
// clang-format on
@@ -284,10 +268,16 @@ bool process_tapping(keyrecord_t *keyp) {
284268
process_record(keyp);
285269
return true;
286270
} else {
287-
// set interrupted flag when other key preesed during tapping
271+
// set interrupted flag when other key pressed during tapping
288272
if (event.pressed) {
289273
tapping_key.tap.interrupted = true;
290-
if (TAP_GET_HOLD_ON_OTHER_KEY_PRESS) {
274+
if (TAP_GET_HOLD_ON_OTHER_KEY_PRESS
275+
# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)
276+
// Auto Shift cannot evaluate this early
277+
// Retro Shift uses the hold action for all nested taps even without HOLD_ON_OTHER_KEY_PRESS, so this is fine to skip
278+
&& !(MAYBE_RETRO_SHIFTING(event, keyp) && get_auto_shifted_key(get_record_keycode(keyp, false), keyp))
279+
# endif
280+
) {
291281
ac_dprintf("Tapping: End. No tap. Interfered by pressed key\n");
292282
process_record(&tapping_key);
293283
tapping_key = (keyrecord_t){0};
@@ -332,6 +322,9 @@ bool process_tapping(keyrecord_t *keyp) {
332322
return true;
333323
} else {
334324
ac_dprintf("Tapping: key event while last tap(>0).\n");
325+
# if defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT)
326+
retroshift_swap_times();
327+
# endif
335328
process_record(keyp);
336329
return true;
337330
}
@@ -388,7 +381,7 @@ bool process_tapping(keyrecord_t *keyp) {
388381
}
389382
// process "released" tapping key state
390383
else {
391-
if (WITHIN_TAPPING_TERM(event) || MAYBE_RETRO_SHIFTING(event)) {
384+
if (WITHIN_TAPPING_TERM(event) || MAYBE_RETRO_SHIFTING(event, keyp)) {
392385
if (IS_NOEVENT(event)) {
393386
// early return for tick events
394387
return true;
@@ -506,9 +499,16 @@ void waiting_buffer_scan_tap(void) {
506499
return;
507500
}
508501

502+
# if (defined(AUTO_SHIFT_ENABLE) && defined(RETRO_SHIFT))
503+
TAP_DEFINE_KEYCODE;
504+
# endif
509505
for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) {
510506
keyrecord_t *candidate = &waiting_buffer[i];
511-
if (IS_EVENT(candidate->event) && KEYEQ(candidate->event.key, tapping_key.event.key) && !candidate->event.pressed && WITHIN_TAPPING_TERM(candidate->event)) {
507+
// clang-format off
508+
if (IS_EVENT(candidate->event) && KEYEQ(candidate->event.key, tapping_key.event.key) && !candidate->event.pressed && (
509+
WITHIN_TAPPING_TERM(waiting_buffer[i].event) || MAYBE_RETRO_SHIFTING(waiting_buffer[i].event, &tapping_key)
510+
)) {
511+
// clang-format on
512512
tapping_key.tap.count = 1;
513513
candidate->tap.count = 1;
514514
process_record(&tapping_key);

quantum/process_keycode/process_auto_shift.c

+17-12
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ __attribute__((weak)) bool get_custom_auto_shifted_key(uint16_t keycode, keyreco
6666
return false;
6767
}
6868

69-
/** \brief Called on physical press, returns whether is Auto Shift key */
69+
/** \brief Called on physical press, returns whether key is an Auto Shift key */
7070
__attribute__((weak)) bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
7171
switch (keycode) {
7272
#ifndef NO_AUTO_SHIFT_ALPHA
@@ -178,9 +178,8 @@ static bool autoshift_press(uint16_t keycode, uint16_t now, keyrecord_t *record)
178178
}
179179

180180
// Store record to be sent to user functions if there's no release record then.
181-
autoshift_lastrecord = *record;
182-
autoshift_lastrecord.event.pressed = false;
183-
autoshift_lastrecord.event.time = 0;
181+
autoshift_lastrecord = *record;
182+
autoshift_lastrecord.event.time = 0;
184183
// clang-format off
185184
#if defined(AUTO_SHIFT_REPEAT) || defined(AUTO_SHIFT_REPEAT_PER_KEY)
186185
if (keycode == autoshift_lastkey &&
@@ -409,8 +408,12 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) {
409408
// If Retro Shift is disabled, possible custom actions shouldn't happen.
410409
// clang-format off
411410
#if defined(RETRO_SHIFT) && !defined(NO_ACTION_TAPPING)
412-
# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
413-
const bool is_hold_on_interrupt = get_hold_on_other_key_press(keycode, record);
411+
# ifdef HOLD_ON_OTHER_KEY_PRESS
412+
const bool is_hold_on_interrupt = (IS_QK_MOD_TAP(keycode)
413+
# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
414+
&& get_hold_on_other_key_press(keycode, record)
415+
# endif
416+
);
414417
# else
415418
const bool is_hold_on_interrupt = false;
416419
# endif
@@ -450,8 +453,12 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) {
450453
#endif
451454
) {
452455
// Fixes modifiers not being applied to rolls with AUTO_SHIFT_MODIFIERS set.
453-
#ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
454-
if (autoshift_flags.in_progress && get_hold_on_other_key_press(keycode, record)) {
456+
#ifdef HOLD_ON_OTHER_KEY_PRESS
457+
if (autoshift_flags.in_progress
458+
# ifdef HOLD_ON_OTHER_KEY_PRESS_PER_KEY
459+
&& get_hold_on_other_key_press(keycode, record)
460+
# endif
461+
) {
455462
autoshift_end(KC_NO, now, false, &autoshift_lastrecord);
456463
}
457464
#endif
@@ -488,10 +495,8 @@ void retroshift_poll_time(keyevent_t *event) {
488495
}
489496
// Used to swap the times of Retro Shifted key and Auto Shift key that interrupted it.
490497
void retroshift_swap_times(void) {
491-
if (last_retroshift_time != 0 && autoshift_flags.in_progress) {
492-
uint16_t temp = retroshift_time;
493-
retroshift_time = last_retroshift_time;
494-
last_retroshift_time = temp;
498+
if (autoshift_flags.in_progress) {
499+
autoshift_time = last_retroshift_time;
495500
}
496501
}
497502
#endif

quantum/process_keycode/process_auto_shift.h

+1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ uint16_t (get_autoshift_timeout)(uint16_t keycode, keyrecord_t *record);
5656
void set_autoshift_timeout(uint16_t timeout);
5757
void autoshift_matrix_scan(void);
5858
bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record);
59+
bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record);
5960
// clang-format on

0 commit comments

Comments
 (0)