/* * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ #include #include #define BASE 0 #define LOWER 1 #define RAISE 2 #define ADJUST 3 / { // Activate ADJUST layer by pressing raise and lower left_encoder: encoder_left { compatible = "alps,ec11"; label = "LEFT_ENCODER"; a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; steps = <80>; }; right_encoder: encoder_right { compatible = "alps,ec11"; label = "RIGHT_ENCODER"; a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; steps = <80>; }; sensors { compatible = "zmk,keymap-sensors"; sensors = <&left_encoder &right_encoder>; triggers-per-rotation = <20>; }; conditional_layers { compatible = "zmk,conditional-layers"; }; behaviors { }; combos { compatible = "zmk,combos"; macro { bindings = <&sl 3>; key-positions = <50 51 52>; }; qwerty { bindings = <&tog 4>; key-positions = <57 58 59>; }; conf { bindings = <&sl 2>; key-positions = <53 56>; }; }; keymap { compatible = "zmk,keymap"; base { label = "base"; // ------------------------------------------------------------------------------------------------------------ // | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | // | ESC | Q | W | E | R | T | | Y | U | I | O | P | BKSPC | // | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | // | SHIFT | Z | X | C | V | B | MUTE | | | N | M | , | . | / | SHIFT | // | GUI | ALT | CTRL | LOWER| ENTER | | SPACE | RAISE| CTRL | ALT | GUI | bindings = < &kp ESCAPE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp TAB &kp Q &kp W &kp F &kp P &kp G &kp J &kp L &kp U &kp Y &kp SEMI &kp SQT &kp BSPC &kp A &kp R &kp S &kp T &kp D &kp H &kp N &kp E &kp I &kp O &kp DEL &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &tog 5 &kp C_MUTE &kp K &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp LCTRL &kp LEFT_WIN &kp LALT &mo 1 &kp RET &kp SPACE &mo 1 &kp RALT &kp RIGHT_WIN &kp RIGHT_CONTROL >; sensor-bindings = <&inc_dec_kp LEFT_ARROW RIGHT_ARROW>, <&inc_dec_kp C_VOL_UP C_VOL_DN>; }; mod { label = "mod"; // TODO: Some binds are waiting for shifted keycode support. // ------------------------------------------------------------------------------------------------------------ // | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | // | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 | // | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | | // | | = | - | + | { | } | | | | [ | ] | ; | : | \ | | // | | | | | | | | | | | | bindings = < &kp GRAVE &trans &trans &trans &trans &trans &trans &trans &trans &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp EQUAL &kp KP_NUMLOCK &kp KP_DIVIDE &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MULTIPLY &trans &trans &trans &trans &trans &kp NON_US_HASH &kp DELETE &kp KP_SUBTRACT &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp HOME &kp PG_UP &kp UP &kp PG_DN &kp INS &kp BACKSPACE &trans &kp KP_N0 &kp KP_N1 &kp KP_NUMBER_2 &kp KP_N3 &kp KP_DOT &trans &trans &kp END &kp LEFT &kp DOWN &kp RIGHT &kp BSLH &trans &trans &trans &trans &trans &kp SPACE &kp ENTER &trans &trans &trans &trans >; }; conf { // ---------------------------------------------------------------------------------------------------------------------------- // | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | | // | EXTPWR | RGB_HUD | RGB_HUI | RGB_SAD | RGB_SAI | RGB_EFF | | | | | | | | // | | RGB_BRD | RGB_BRI | | | | | | | | | | | // | | | | | | | RGB_TOG | | | | | | | | | // | | | | | | | | | | | | label = "conf"; bindings = < &trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &trans &trans &trans &trans &trans &trans &none &none &none &none &none &kp F12 &none &trans &trans &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &trans &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none &none >; }; macro { bindings = < &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 &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 >; label = "macro"; }; qwerty { bindings = < &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &trans &trans &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &trans &trans &kp Z &kp X &kp C &kp V &kp B &trans &trans &kp N &kp M &kp COMMA &kp DOT &kp FSLH &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans >; label = "qwerty"; }; encoder-alt { bindings = < &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 &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 >; sensor-bindings = <&inc_dec_kp UP_ARROW DOWN>; label = "encoder-alt"; }; }; };