zmkfirmware / zmk

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

Feature request: antecedent-morph (aka adaptive keys) #1624

Open urob opened 1 year ago

urob commented 1 year ago

This is an idea for a new behavior, which I think could be really useful and open up all sorts of creative uses:

The antecedent-morph behavior would trigger an alternative binding if within timeout-ms the immediate predecessor matches the trigger condition. This would enable using adaptive keys where certain keys change their meaning if pressed immediately after another key, as popularized by the Hands Down layouts.

For instance, in the Hands Down layout, ,A send UA. Using the proposed behavior, this could be implemented by replacing &kp A with a antecedent-morph configured as follows:

adaptive_A: adaptive_A {
    compatible=  "zmk,behavior-antecedent-morph";
    bindings = <&kp A>, <&morphed_A>;
    timeout-ms = <1000>;
    antecedent = <&kp DOT>:
}

and where &morphed_A is a macro executing BACKSPACE, U, A.

caksoylar commented 11 months ago

Would be fixed by #2042.