Hijacking repeat key functionality #40
-
Hey there! Is it possible to borrow some of the repeat key’s functionality (in this case: checking the last keycode) to alter the behaviour of macros? My understandig of C (and programming in general) is very limited, but I tried the code below in
Anyways, thank you for all of your wonderful contributions to QMK! I use every single feature in my keymap, thanks to your easy-to-follow documentation! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
That's a cool use of Repeat Key! Yes, that "hijacking" should be possible. Be sure that bool remember_last_key_user(uint16_t keycode, keyrecord_t* record,
uint8_t* remembered_mods) {
switch (keycode) {
case COMMA_MACRO:
return false; // Ignore this key.
}
return true; // Other keys are remembered.
} Without that definition, the problem is that when |
Beta Was this translation helpful? Give feedback.
That's a cool use of Repeat Key! Yes, that "hijacking" should be possible.
Be sure that
remember_last_key_user()
is defined to ignoreCOMMA_MACRO
like this:Without that definition, the problem is that when
COMMA_MACRO
is pressed, the "last key" returned byget_last_keycode()
changes toCOMMA_MACRO
by the time thatprocess_record_user()
is called. I have to admit that is rather confusing. See also the "Additional Alte…