110 lines
4.7 KiB
Text
110 lines
4.7 KiB
Text
/*
|
|
* Copyright (c) 2023 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#include <behaviors.dtsi>
|
|
#include <dt-bindings/zmk/keys.h>
|
|
#include <dt-bindings/zmk/bt.h>
|
|
#include <dt-bindings/zmk/rgb.h>
|
|
#include <dt-bindings/zmk/ext_power.h>
|
|
#include <dt-bindings/zmk/outputs.h>
|
|
|
|
#define DEFAULT 0
|
|
#define FN 1
|
|
#define SETTINGS 2
|
|
#define LOCK 3
|
|
|
|
#define TIMEOUT 300
|
|
|
|
&encoder_1 {
|
|
status = "okay";
|
|
};
|
|
|
|
/ {
|
|
combos {
|
|
compatible = "zmk,combos";
|
|
combo_btclr {
|
|
timeout-ms = <TIMEOUT>;
|
|
key-positions = <1 6>;
|
|
bindings = <&bt BT_CLR>;
|
|
};
|
|
combo_reset {
|
|
timeout-ms = <TIMEOUT>;
|
|
key-positions = <1 3>;
|
|
bindings = <&sys_reset>;
|
|
};
|
|
combo_bootloader {
|
|
timeout-ms = <TIMEOUT>;
|
|
key-positions = <1 15>;
|
|
bindings = <&bootloader>;
|
|
};
|
|
combo_lock {
|
|
timeout-ms = <TIMEOUT>;
|
|
key-positions = <1 12>;
|
|
bindings = <&tog LOCK>;
|
|
};
|
|
combo_bt_nxt {
|
|
timeout-ms = <TIMEOUT>;
|
|
key-positions = <1 4>;
|
|
bindings = <&bt BT_NXT>;
|
|
};
|
|
};
|
|
|
|
sensors {
|
|
compatible = "zmk,keymap-sensors";
|
|
sensors = <&encoder_1>;
|
|
};
|
|
|
|
keymap0: keymap {
|
|
compatible = "zmk,keymap";
|
|
|
|
default_layer {
|
|
label = "default layer";
|
|
bindings = <
|
|
&kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC
|
|
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH
|
|
&mo FN &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp APOS &trans &kp ENTER
|
|
&kp LSHFT &trans &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp UP &ext_power EP_TOG
|
|
&kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &mo FN &kp RCTRL &kp LEFT &kp DOWN &kp RIGHT
|
|
>;
|
|
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
|
|
};
|
|
|
|
fn_layer {
|
|
label = "fn layer";
|
|
bindings = <
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp DEL
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &mo SETTINGS &trans &trans &trans
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp PG_UP &ext_power EP_TOG
|
|
&trans &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_DN &kp END
|
|
>;
|
|
sensor-bindings = <&inc_dec_kp PG_UP PG_DN>;
|
|
};
|
|
|
|
setting_layer {
|
|
label = "settings layer";
|
|
bindings = <
|
|
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans &trans &kp DEL
|
|
&trans &trans &trans &trans &sys_reset &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
&trans &trans &trans &trans &trans &trans &bootloader &trans &trans &trans &trans &trans &trans &trans &rgb_ug RGB_EFF
|
|
&trans &out OUT_BLE &out OUT_USB &trans &trans &trans &trans &trans &trans &trans
|
|
>;
|
|
sensor-bindings = <&inc_dec_kp PG_UP PG_DN>;
|
|
};
|
|
|
|
lock_layer {
|
|
label = "fn layer";
|
|
bindings = <
|
|
&none &none &none &none &none &none &none &none &none &none &none &none &none &none
|
|
&none &none &none &none &none &none &none &none &none &none &none &none &none &none
|
|
&none &none &none &none &none &none &none &none &none &none &none &none &none &none
|
|
&none &none &none &none &none &none &none &none &none &none &none &none &none &none &none
|
|
&none &none &none &none &none &none &none &none &none &none
|
|
>;
|
|
};
|
|
};
|
|
};
|