Open chuan2984 opened 1 day ago
Hello, @chuan2984! Thank you for the in-depth description and such a thorough investigation! Unfortunately, there is nothing you can do in version 0.4.0 about it. I didn't add support for key repeats or alt_repeats. The good news is that I'm developing version 0.5.0, which is supposed to fix that.
The current problem with repeats in version 0.4.0 is the way process_smtd()
works. That function receives CKC_D
and produces a KC_D
tap by calling the tap_code(KC_D)
function, which directly sends a signal to the OS. However, QMK's repeat feature reads incoming events before actually calling process_record_user()
, so it knows about CKC_D
but doesn't know anything about tap_code(KC_D)
in process_smtd()
.
While writing that, I got an idea. Maybe defining get_alt_repeat_key_keycode_user()
(see https://docs.qmk.fm/features/repeat_key) with CKC_D -> KC_U
might fix that, maybe not. There is also tricky behavior for holding CKC_F
, so that might affect the repeat feature too.
Problem Summary
In my QMK setup, I have the REPEAT key feature working, but there’s an issue when trying to use it with ALT_REPEAT for certain keys. Specifically, the ALT_REPEAT function fails when used with keys defined using sm_td mappings, such as a, k, and d. However, ALT_REPEAT works as expected with other keys.
Here's the setup for my mod-tap keys, structured similarly to a homerow mod configuration:
Problem Behavior
When I attempt to execute a command like Ctrl+D by holding down the CKC_F (which acts as Ctrl) and pressing d, followed by the ALT_REPEAT key, nothing happens. However, this combination works with keys that aren't defined using sm_td. For example, Ctrl+U followed by ALT_REPEAT correctly repeats Ctrl+D.
After enabling QMK debugging and adding print statements in process_record_user, I observed that when holding down CKC_F and tapping a, k, or d (which are mapped using sm_td), the print statements aren't triggered. This suggests that process_smtd(keycode, record) is returning false. However, tapping other non-sm_td keys correctly triggers the print statements, implying that process_smtd returns true for those keys.
Here’s my process_record_user function:
The core issue is that process_smtd(keycode, record) returns false for the mod-tap keys when using the sm_td configuration, and thus the rest of the logic in process_record_user is skipped. I'd appreciate any insights on how to fix or adjust this behavior, as I'm not entirely sure what the correct expected behavior should be.