zmkfirmware/zmk

Feature request: preserve locality outside of direct keymap bindings

manna-harbour opened this issue · 3 comments

Combos do not preserve locality as noted at https://zmk.dev/docs/features/combos:

SOURCE-SPECIFIC BEHAVIORS ON SPLIT KEYBOARDS
Invoking a source-specific behavior such as one of the reset behaviors using a combo will always trigger it on the central side of the keyboard, regardless of the side that the keys corresponding to key-positions are on.

It seems that this also applies to tap dance and mod morph. I guess it applies to everything other than a direct keymap binding and that the locality system will need to be extended.

In the mean time, a note should be added to the reset behavior docs.

Could this be resolved by setting global locality for the combo behaviours like it was for RGB underglow and ext power in https://github.com/zmkfirmware/zmk/pull/547/files#diff-fa3059ddb7abee58e50dbc5bb6b0218e6e4948d3742539e4f3a9aa67a1eb7278R149 ?

This bug also applied to global behaviours like ext power and RGB underglow for me. Without bobobo1618/miryoku_zmk@6ba964f, the changes only applied to the central half.

Updating this issue:

All behaviors using the locality system (#547) do not work as intended on split keyboards when the behavior is not bound directly in the keymap. If the behavior is called from any other behavior the locality information is lost and the behavior is run only on central. I.e. source-specific behaviors (https://zmk.dev/docs/behaviors/reset) invoked from indirect bindings on peripheral will run on central instead of peripheral, and global behaviors (https://zmk.dev/docs/behaviors/underglow, https://zmk.dev/docs/behaviors/power) invoked from indirect bindings will run only on central instead of on central and peripheral.

The locality system should be extended to preserve locality information when invoked indirectly.

In the mean time, the docs (#1124) should have a warning added for all behaviors with locality (pages linked above), and the current warning at https://zmk.dev/docs/features/combos should be removed.

Work-arounds have been added to Miryoku ZMK: