Skip to content

Hijacking repeat key functionality #40

Answered by getreuer
noamvokaal asked this question in Q&A
Discussion options

You must be logged in to vote

That's a cool use of Repeat Key! Yes, that "hijacking" should be possible.

Be sure that remember_last_key_user() is defined to ignore COMMA_MACRO like this:

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 COMMA_MACRO is pressed, the "last key" returned by get_last_keycode() changes to COMMA_MACRO by the time that process_record_user() is called. I have to admit that is rather confusing. See also the "Additional Alte…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@noamvokaal
Comment options

@noamvokaal
Comment options

Answer selected by noamvokaal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants