Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hold-taps should honor transparency within the bindings. #2368

Open
amacleod opened this issue Jul 8, 2024 · 4 comments
Open

Hold-taps should honor transparency within the bindings. #2368

amacleod opened this issue Jul 8, 2024 · 4 comments

Comments

@amacleod
Copy link
Contributor

amacleod commented Jul 8, 2024

When one of the bindings of a hold-tap is &trans, the behavior should look at lower layers' bindings when that portion of the hold-tap is activated.

behaviors {
  hmt: homerow_mod_transparent {
    compatible = "zmk,behavior-hold-tap";
    #binding-cells = <2>;
    bindings = <&kp>, <&trans>;
    // ... and any other mandatory fields
  };
};
keymap {
  base_layer { bindings = <&kp A>; };
  other_layer { bindings = <&kp B>; };
  overlay_mods_layer {
    bindings = <&hmt LSHFT 0>;
  };
};

Expected behavior: when the overlay mods layer is active, tapping the key should either send a or b depending on which lower layer is active.

Actual behavior: tapping the key does nothing when the overlay layer is active, just as if the second binding were &none. The hold behavior works fine.


https://github.com/amacleod/zmk-config/blob/hold-tap-trans-repro/config/corne.keymap#L381-L391 is an example of me trying to use a transparent hold-tap to make a floating home row mods layer.

@amacleod
Copy link
Contributor Author

amacleod commented Jul 8, 2024

Linking the locality-preservation issue #1494 as @caksoylar mentioned that it might be related

@caksoylar
Copy link
Contributor

I looked into this a bit and fixing #1494 apparently didn't fix it. &trans behavior doesn't do anything special besides returning a positive code, and that is processed by the keymap logic to fall through to other layers. But hold-tap doesn't propagate up the return code of some of the behaviors it invokes due to its complex decision logic. Maybe this can be fixed, but it seems difficult (to me) for not much gain.

@amacleod
Copy link
Contributor Author

amacleod commented Feb 1, 2025

If the effort:effect ratio would be too low, I am okay with closing this issue as "won't fix". Any action needed from me in that regard?

@caksoylar
Copy link
Contributor

I guess this isn't an architectural decision to "won't fix" so we can leave this open if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants