zmkfirmware / zmk

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

Sticky layer documentation is unclear #2293

Open shunlog opened 2 months ago

shunlog commented 2 months ago

It is not clear what's meant by "key press" in the sentence "A sticky layer stays pressed until another key is pressed." on the sticky layer page. One would think it means when you physically press any key, but actually the sticky layer is only deactivated when a keycode is sent, so for example it isn't deactivated on a layer toggle, or on caps word activation.

It should be clarified, either by replacing "key pressed" with "keycode sent", or adding an info box or something.

shunlog commented 2 months ago

BTW, can someone explain why would it be desirable for the sticky layer to be disabled only on a keycode sent, instead of on any key-press?

caksoylar commented 2 months ago

A docs update would be welcome. I also had this general thought on sticky keys and opened #2273:

I think we should fix sticky keys/layers pages to be more like hold-tap and mod-taps: There should be an intro to the generic/user-defined behavior-sticky-key in the former, and it should also mention the pre-defined &sk. Sticky layer page should have a note box saying it is just a sticky key with bindings = <&mo>.

BTW, can someone explain why would it be desirable for the sticky layer to be disabled only on a keycode sent, instead of on any key-press?

Historically the reason it works this way is related to above, since sticky layer is simply an instance of sticky key, and sticky keys only listen to keycode change events (rather than "position" change events in ZMK parlance).

I don't know which behavior would be desired, I can see it either way. e.g. you might want to use two sticky layer invocations to toggle a conditional layer, which would require the first sticky key to not be deactivated on toggling the second one. Maybe it should be an option in behavior,sticky-key to get disabled on keycode or position changed event.