Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process_record_user, layer_on, auto-repeat #556

Closed
hia3 opened this issue Jul 25, 2016 · 2 comments
Closed

process_record_user, layer_on, auto-repeat #556

hia3 opened this issue Jul 25, 2016 · 2 comments

Comments

@hia3
Copy link

hia3 commented Jul 25, 2016

I'd like a key from one layer to do whatever is configured in another layer.

When moonlit_winter_nights is set to true, I press and hold my button - this givest me correct character (from another layer), but not auto-repeat. Why?

bool process_record_user(uint16_t kc, keyrecord_t * record)
{
    if (kc == KC_A && moonlit_winter_nights)
    {
        action_t action;
        layer_on(SYMB);

        action = store_or_get_action(record->event.pressed, record->event.key);
        process_action(record, action);

        layer_off(SYMB);

        return false;
    }
    else
    {
        return true;
    }
}
@algernon
Copy link
Contributor

That's because layer_off() calls clear_keyboard_but_mods(), and thus unregisters the key. As a workaround, instead of switching layers and triggering an action, you could lfit the action out into a function and call it from both places.

@hia3
Copy link
Author

hia3 commented Jul 25, 2016

Thanks!

@hia3 hia3 closed this as completed Jul 25, 2016
BlueTufa pushed a commit to BlueTufa/qmk_firmware that referenced this issue Aug 6, 2021
* Add files via upload

* Add files via upload

* Update index.js

Co-Authored-By: yiancar <[email protected]>
jiaxin96 pushed a commit to Oh-My-Mechanical-Keyboard/qmk_firmware that referenced this issue Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants