#Having a macro repeat on hold as any other key

1 messages · Page 1 of 1 (latest)

hoary charm
#

Hello all :)

I have a macro that outputs the letter É. As it is an alphanumeric character, I want it to repeat when holding its key, just like any other letter of my keyboard.

I discovered the key repeat behavior but I am unsure about how to make it work with my macro to achieve what I want, and whether it's even the right strategy.
I tried dedicating a key to the key repeat behavior to make tests and it works well repeating my macro for É or Ç for example, but for some reason À or È get repeated as A or E, so it seems to have a little bug with my grave-accented letters.
Here is my full keymap: https://pastebin.com/5aiABt32. Note: I am using the US INTL keyboard on Windows when I use this keyboard (wireless Corne).

If what I want is not possible, is it planned to add the ability to add a keyword in the macro definition saying "you can hold"?

Any idea how to do this? Thanks for your help!

novel cradle
#

The idea is, you press whatever keys you want to press, you wait for release of the macro key, then release whatever keys you initially pressed. This way, the keys will be held as long as you hold down the macro key, rather than being "tapped" when you first press it

hoary charm
# novel cradle The idea is, you press whatever keys you want to press, you wait for release of ...

Hey! Thank you for your help, this indeed worked to repeat some of my macros when holding their key. I did this for É, which worked:

e_capital_acute: e_capital_acute {
    compatible = "zmk,behavior-macro";
    #binding-cells = <0>;
    wait-ms = <0>;
    tap-ms = <0>;
    bindings
        = <&macro_press   &kp RALT>
        , <&macro_press   &kp LS(E)>
        , <&macro_pause_for_release>
        , <&macro_release &kp RALT>
        , <&macro_release &kp LS(E)>
        ;
};

However, when it comes to the macros involving dead keys, such as the one producing À or È, the repetition does not work as expected, as previously explained. I tried a couple different ways, as explained below, so if you have any workaround feel free to tell me! :)

For À when I hold the key it outputs ÀAAAAAAAAAAAAAAAAAAAAAAA.

I tried to replicate this behavior with other macros and I did, with basically any macro that has more than one non-modifier key - from what I've seen at least.
Example with the macro below, outputing proofffffffff when holding the key.

proof_test: proof_test {
    compatible = "zmk,behavior-macro";
    #binding-cells = <0>;
    wait-ms = <0>;
    tap-ms = <0>;
    bindings
        = <&macro_press &kp P &kp R &kp O &kp O &kp F>
        , <&macro_pause_for_release>
        , <&macro_release &kp P &kp R &kp O &kp O &kp F>
        ;
};

I also tried a different way to output an apostrophe (it needs a space to be displayed directly, as in the US-INTL layout it is a dead key).
When I hold the key, the macro outputs ' .

apos: apos {
    compatible = "zmk,behavior-macro";
    #binding-cells = <0>;
    wait-ms = <0>;
    tap-ms = <0>;
    bindings
        = <&macro_press   &kp APOSTROPHE>
        , <&macro_press   &kp SPACE>
        , <&macro_pause_for_release>
        , <&macro_release &kp APOSTROPHE>
        , <&macro_release &kp SPACE>
        ;
};

We can basically see that the latest character from a macro gets repeated.

novel cradle
#

You cannot apply the same logic to holding down multiple non modifiers: OS typically ignores all but the last pressed one

#

However I am surprised that OS doesn't repeat the accented key when both altgr and letter is held