zmkfirmware / zmk

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

[BUG] sticky key in macro does not release #2609

Open Incblob opened 3 weeks ago

Incblob commented 3 weeks ago

Bug:

When a macro that contains a sticky LSHIFT is run while other typing is happening, the release for the LSHIFT is either not read/ not sent, resulting in a stuck LSHIFT. Unplugging the kb does not release the key. This affects not only typing but the OS. The shift key is effectively always pressed.

To release the LSHIFT, you have to either

I'm connected via USB, if that makes a difference. I'm assuming that this will happen with other modifiers as well.

Config:

&sk {
    release-after-ms = <1000>;
    quick-release;
};

ZMK_MACRO(test_sk,
        wait-ms = <20>;
        tap-ms = <20>;
        bindings = <&kp SPACE &sk LSHIFT>; 
    )
ZMK_MACRO(release_sk,
        wait-ms = <20>;
        tap-ms = <20>;
        bindings = <&macro_release &kp LSHIFT>;
    )

example typing behavior:

ststststst* sTSTSTSTSTS*tststststst start of sk macro **release macro

Environment:

OS: Win10 board: Horizon repo: https://github.com/Incblob/zmk-config-horizon connection: USB

lesshonor commented 3 weeks ago

It might be a good idea for you to test #2257.

https://zmk.dev/docs/features/modules#beta-testing