qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
18.24k stars 39.3k forks source link

[Feature Request] Disable autoshift on a layer #8946

Closed Yamakaky closed 4 years ago

Yamakaky commented 4 years ago

Feature Request Type

Description

On my Ergodox EZ, I have a letter layer, a special keys layer (alt-grey in french azerty), a media layer (pause, volume control...) and a gaming layer with only simple keys (no tap-hold or double function keys). I'd like auto-shift to be automatically enabled on the first two layers but not the later two. I don't think this possible currently, you have to toggle it manually. Would it be possible to make it configurable, maybe with a blacklist/whitelist of layers?

Yamakaky commented 4 years ago

Tagging @ezuk after our mail discussion.

IsaacElenbaas commented 4 years ago

I did this by modifying my layer toggles, but it gets complicated fast if there are multiple ways to get out of any layer. Would be very convenient and great for code readability.

IsaacElenbaas commented 4 years ago

Pretty easy implementation now that I think about it - just check layer here and return true, no need to actually enable/disable AutoShift on layer status changes. Not sure what a clean way of specifying the non-autoshifted layers would be, though.

Nadrieril commented 4 years ago

You might be able to enable/disable autoshift from your keymap file like this:

uint32_t layer_state_set_user(uint32_t state) {
    if (autoshift_enabled && (state & (1<<MEDIA_LAYER) || state & (1<<GAMING_LAYER))) {
        autoshift_disable();
    } else {
        autoshift_enable();
    }
    ...
    return state;
};

I haven't tested that but I use something similar to have a custom swap_hands layer which changes some keys in addition to enabling the swap_hands feature.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity occurs. For maintainers: Please label with bug, in progress, on hold, discussion or to do to prevent the issue from being re-flagged.

mikeduminy commented 4 years ago

I would also like this feature

stale[bot] commented 4 years ago

This issue has been automatically closed because it has not had activity in the last 30 days. If this issue is still valid, re-open the issue and let us know.

byamagata commented 2 years ago

Are there any other requests like this that I can try and find for a solution? This would be great and I would love to see this happen!