#include <dt-bindings/zmk/keys.h>
#include <behaviors.dtsi>
#include <dt-bindings/zmk/kscan_mock.h>

&kscan {
    events = <
        /* Shift + hold &mod_morph --> expect and get D (no shift) */
        ZMK_MOCK_PRESS(0,0,10)
        ZMK_MOCK_PRESS(0,1,200)
        ZMK_MOCK_PRESS(1,0,10)
        ZMK_MOCK_RELEASE(1,0,10)
        ZMK_MOCK_RELEASE(0,1,10)
        ZMK_MOCK_RELEASE(0,0,10)
    >;
};

/ {
    behaviors {
        mod_morph: mod_morph {
            compatible = "zmk,behavior-mod-morph";
            #binding-cells = <0>;
            bindings = <&kp A>, <&lt 1 B>;
            mods = <(MOD_LSFT|MOD_RSFT)>;
        };

    };

    keymap {
        compatible = "zmk,keymap";

        default_layer {
            bindings = <
                &kp LEFT_SHIFT &mod_morph
                &kp C &none
            >;
        };

        second_layer {
            bindings = <
                &trans &trans
                &kp D &trans
            >;
        };
    };
};
