zmk icon indicating copy to clipboard operation
zmk copied to clipboard

Sticky layer documentation is unclear

Open shunlog opened this issue 1 year ago • 3 comments

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 avatar May 03 '24 14:05 shunlog

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?

shunlog avatar May 03 '24 14:05 shunlog

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.

caksoylar avatar May 03 '24 16:05 caksoylar

'Press binding' is often used in the code base. The sticky key documentation probably avoids introducing too many concepts or terms to users. The term 'binding' becomes even less relevant since sticky key rarely requires advanced configuration, unlike Combo or Sensor. We should have a dedicated page to explain 'what is binding'. Then sticky key and other behaviors can be described much more easily and accurately.

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?

It's been an ongoing issue. https://github.com/zmkfirmware/zmk/issues/1689

nguyendown avatar Aug 04 '24 17:08 nguyendown