zmkfirmware / zmk

ZMK Firmware Repository
https://zmk.dev/
MIT License
2.63k stars 2.69k forks source link

Toggle layer until an idle timeout has been reached #2403

Open kovasap opened 1 month ago

kovasap commented 1 month ago

I'd like to try toggling a layer until a configurable number of seconds has elapsed, at which point the layer would toggle off. Is there any way to do this in zmk currently?

caksoylar commented 1 month ago

Not exactly as described. Sticky layers have a timeout but they'll also deactivate the layer before the timeout if any keycode is sent.

kovasap commented 1 month ago

Right, I use those already!

On Sun, Aug 4, 2024, 1:13 PM Cem Aksoylar @.***> wrote:

Not exactly as described. Sticky layers https://zmk.dev/docs/behaviors/sticky-layer have a timeout but they'll also deactivate the layer before the timeout if any keycode is sent.

— Reply to this email directly, view it on GitHub https://github.com/zmkfirmware/zmk/issues/2403#issuecomment-2267655890, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3NAVI5DS7UR63KNJ3VNDZP2DP3AVCNFSM6AAAAABL6PAL5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRXGY2TKOBZGA . You are receiving this because you authored the thread.Message ID: @.***>

caksoylar commented 1 month ago

I think a clever application of the tri-state behavior (#1366, also available as a module) using the timeout-ms property and &tog bindings might work for this. But you might need to set ignored-* properties as well.