/*
 * Copyright (c) 2022 The ZMK Contributors
 *
 * SPDX-License-Identifier: MIT
 */

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

/ {
    macros {
        slash_macro: slash_macro {
            #binding-cells = <2>;
            compatible = "zmk,behavior-macro-two-param";
            wait-ms = <40>;
            tap-ms = <40>;
            bindings = <
                &macro_param_1to1 &kp MACRO_PLACEHOLDER
                &kp SLASH
                &macro_param_2to1 &kp MACRO_PLACEHOLDER>;
        };

        to_second_macro: to_second_macro {
            #binding-cells = <2>;
            compatible = "zmk,behavior-macro-two-param";
            wait-ms = <40>;
            tap-ms = <40>;
            bindings = <
                &macro_param_1to2 &mt LSHIFT MACRO_PLACEHOLDER
                &macro_param_2to2 &mt RSHIFT MACRO_PLACEHOLDER>;
        };

        quote_letter_macro: quote_letter_macro {
            #binding-cells = <1>;
            compatible = "zmk,behavior-macro-one-param";
            wait-ms = <40>;
            tap-ms = <40>;
            bindings = <
                &kp QUOT
                &macro_param_1to1 &kp MACRO_PLACEHOLDER
                &kp QUOT>;
        };
    };

    keymap {
        compatible = "zmk,keymap";

        default_layer {
            bindings = <
            &slash_macro A B &quote_letter_macro B
            &to_second_macro E F &kp C>;
        };
    };
};

&kscan {
    events = <ZMK_MOCK_PRESS(0,0,20) ZMK_MOCK_PRESS(0,1,10) ZMK_MOCK_RELEASE(0,1,10) ZMK_MOCK_RELEASE(0,0,10) ZMK_MOCK_PRESS(1,0,10) ZMK_MOCK_RELEASE(1,0,1000)>;
};