diff --git a/config/am_hatsu.keymap b/config/am_hatsu.keymap index 59ae6ce..7b2e318 100644 --- a/config/am_hatsu.keymap +++ b/config/am_hatsu.keymap @@ -2,144 +2,194 @@ * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT - */ - -#include -#include -#include -#include -#include - -/ { - macros { - layer_s: layer_s { - label = "layer shift color"; - compatible = "zmk,behavior-macro"; - #binding-cells = <0>; - wait-ms = <0>; - tap-ms = <0>; - bindings = - <¯o_press>, - <&kp LSHFT>, - <¯o_tap>, - <&rgb_ug RGB_COLOR_HSB(35,100,50)>, - <¯o_pause_for_release>, - <¯o_release>, - <&kp LSHFT>, - <¯o_tap>, - <&rgb_ug RGB_COLOR_HSB(240,50,30)>; - }; - - layer_1: layer_1 { - label = "layer 1"; - compatible = "zmk,behavior-macro"; - #binding-cells = <0>; - wait-ms = <0>; - tap-ms = <0>; - bindings = - <¯o_press>, - << 1 END>, - <¯o_tap>, - <&rgb_ug RGB_COLOR_HSB(300,100,50)>, - <¯o_pause_for_release>, - <¯o_release>, - << 1 END>, - <¯o_tap>, - <&rgb_ug RGB_COLOR_HSB(240,50,30)>; - }; - - layer_2: layer_2 { - label = "layer 2"; - compatible = "zmk,behavior-macro"; - #binding-cells = <0>; - wait-ms = <0>; - tap-ms = <0>; - bindings = - <¯o_press>, - <&mo 2>, - <¯o_tap>, - <&rgb_ug RGB_COLOR_HSB(175,100,50)>, - <¯o_pause_for_release>, - <¯o_release>, - <&mo 2>, - <¯o_tap>, - <&rgb_ug RGB_COLOR_HSB(240,50,30)>; - }; - - layer_3: layer_3 { - label = "layer 3"; - compatible = "zmk,behavior-macro"; - #binding-cells = <0>; - wait-ms = <0>; - tap-ms = <0>; - bindings = - <¯o_press>, - << 3 DEL>, - <¯o_tap>, - <&rgb_ug RGB_COLOR_HSB(0,100,50)>, - <¯o_pause_for_release>, - <¯o_release>, - << 3 DEL>, - <¯o_tap>, - <&rgb_ug RGB_COLOR_HSB(240,50,30)>; - }; - }; - - behaviors { - hm: homerow_mods { - compatible = "zmk,behavior-hold-tap"; - label = "HOMEROW_MODS"; - #binding-cells = <2>; - tapping-term-ms = <150>; - quick-tap-ms = <0>; - flavor = "tap-preferred"; - bindings = <&kp>, <&kp>; - }; - - aa: aa { - compatible = "zmk,behavior-tap-dance"; - label = "select all"; - #binding-cells = <0>; - tapping-term-ms = <100>; - bindings = <&kp A>, <&kp LG(A)>; - }; - - cc: cc { - compatible = "zmk,behavior-tap-dance"; - label = "copy"; - #binding-cells = <0>; - tapping-term-ms = <100>; - bindings = <&kp C>, <&kp LG(C)>; - }; - - cv: cv { - compatible = "zmk,behavior-tap-dance"; - label = "paste"; - #binding-cells = <0>; - tapping-term-ms = <100>; - bindings = <&kp V>, <&kp LG(V)>; - }; - - cx: cx { - compatible = "zmk,behavior-tap-dance"; - label = "cut"; - #binding-cells = <0>; - tapping-term-ms = <100>; - bindings = <&kp X>, <&kp LG(X)>; - }; - }; - + */ + +#include +#include +#include +#include +#include + +/ { + macros { + layer_s: layer_s { + label = "layer shift color"; + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + wait-ms = <0>; + tap-ms = <0>; + bindings = + <¯o_press>, + <&kp LSHFT>, + <¯o_tap>, + <&rgb_ug RGB_COLOR_HSB(35,100,50)>, + <¯o_pause_for_release>, + <¯o_release>, + <&kp LSHFT>, + <¯o_tap>, + <&rgb_ug RGB_COLOR_HSB(240,50,30)>; + }; + + layer_1: layer_1 { + label = "layer 1"; + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + wait-ms = <0>; + tap-ms = <0>; + bindings = + <¯o_press>, + << 1 END>, + <¯o_tap>, + <&rgb_ug RGB_COLOR_HSB(300,100,50)>, + <¯o_pause_for_release>, + <¯o_release>, + << 1 END>, + <¯o_tap>, + <&rgb_ug RGB_COLOR_HSB(240,50,30)>; + }; + + layer_2: layer_2 { + label = "layer 2"; + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + wait-ms = <0>; + tap-ms = <0>; + bindings = + <¯o_press>, + <&mo 2>, + <¯o_tap>, + <&rgb_ug RGB_COLOR_HSB(175,100,50)>, + <¯o_pause_for_release>, + <¯o_release>, + <&mo 2>, + <¯o_tap>, + <&rgb_ug RGB_COLOR_HSB(240,50,30)>; + }; + + layer_3: layer_3 { + label = "layer 3"; + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + wait-ms = <0>; + tap-ms = <0>; + bindings = + <¯o_press>, + << 3 DEL>, + <¯o_tap>, + <&rgb_ug RGB_COLOR_HSB(0,100,50)>, + <¯o_pause_for_release>, + <¯o_release>, + << 3 DEL>, + <¯o_tap>, + <&rgb_ug RGB_COLOR_HSB(240,50,30)>; + }; + }; + + combos { + compatible = "zmk,combos"; + + combo_esc { + timeout-ms = <50>; + key-positions = <0 1>; + bindings = <&kp ESC>; + }; + + left_bkt { + bindings = <&kp LEFT_BRACKET>; + key-positions = <3 4>; + }; + + right_bkt { + bindings = <&kp RIGHT_BRACKET>; + key-positions = <7 8>; + }; + + left_brace { + bindings = <&kp LEFT_BRACE>; + key-positions = <26 27>; + }; + + right_brace { + bindings = <&kp RIGHT_BRACE>; + key-positions = <30 31>; + }; + + less_than { + bindings = <&kp LESS_THAN>; + key-positions = <15 16>; + }; + + great_than { + bindings = <&kp GREATER_THAN>; + key-positions = <18 19>; + }; + + pipe { + bindings = <&kp PIPE>; + key-positions = <15 20>; + }; + + back_slash { + bindings = <&kp BACKSLASH>; + key-positions = <3 8>; + }; + }; + + behaviors { + hm: homerow_mods { + compatible = "zmk,behavior-hold-tap"; + label = "HOMEROW_MODS"; + #binding-cells = <2>; + tapping-term-ms = <150>; + quick-tap-ms = <0>; + flavor = "tap-preferred"; + bindings = <&kp>, <&kp>; + }; + + aa: aa { + compatible = "zmk,behavior-tap-dance"; + label = "select all"; + #binding-cells = <0>; + tapping-term-ms = <100>; + bindings = <&kp A>, <&kp LG(A)>; + }; + + cc: cc { + compatible = "zmk,behavior-tap-dance"; + label = "copy"; + #binding-cells = <0>; + tapping-term-ms = <100>; + bindings = <&kp C>, <&kp LG(C)>; + }; + + cv: cv { + compatible = "zmk,behavior-tap-dance"; + label = "paste"; + #binding-cells = <0>; + tapping-term-ms = <100>; + bindings = <&kp V>, <&kp LG(V)>; + }; + + cx: cx { + compatible = "zmk,behavior-tap-dance"; + label = "cut"; + #binding-cells = <0>; + tapping-term-ms = <100>; + bindings = <&kp X>, <&kp LG(X)>; + }; + }; + #define DEFAULT 0 #define NUMBER 1 #define SYMBOL 2 -#define HOTKEY 3 - - keymap { - compatible = "zmk,keymap"; - - default_layer { - label = "DEFAULT"; - +#define HOTKEY 3 + + keymap { + compatible = "zmk,keymap"; + + default_layer { + label = "DEFAULT"; + // ----------------------------------------------------------------------------------------------------------------------------------- // | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | // | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | @@ -147,19 +197,19 @@ // | | GUI | ~ |SHIFT | SPACE| | ENTER| BSPC | - | = | // | | | CTRL | DEL | | HOME | CTRL | // | | | ALT | LEFT | | END | ALT | - - bindings = < -< 3 ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp MINUS -&kp GRAVE &hm A LEFT_GUI &hm S LEFT_ALT &hm D LCTRL &hm F LEFT_SHIFT &kp G &kp H &hm J RIGHT_SHIFT &hm K RCTRL &hm L RCTRL &hm SEMI RIGHT_GUI &kp SQT -&layer_s &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT -< 4 BACKSPACE &layer_1 &kp END &kp HOME &kp LBKT &kp BSLH &kp EQUAL &kp RBKT &kp MINUS &kp EQUAL &layer_2 < 5 DEL - < 1 TAB < 6 SPACE < 6 SPACE < 2 ENTER - >; - }; - - number_layer { - label = "NUMBER"; - + + bindings = < +< 3 ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp MINUS +&kp GRAVE &hm A LEFT_GUI &hm S LEFT_ALT &hm D LCTRL &hm F LEFT_SHIFT &kp G &kp H &hm J RIGHT_SHIFT &hm K RCTRL &hm L RCTRL &hm SEMI RIGHT_GUI &kp SQT +&layer_s &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT +< 4 BACKSPACE &layer_1 &kp END &kp HOME &kp LBKT &kp BSLH &kp EQUAL &kp RBKT &kp MINUS &kp EQUAL &layer_2 < 5 DEL + < 1 TAB < 6 SPACE < 6 SPACE < 2 ENTER + >; + }; + + number_layer { + label = "NUMBER"; + // ------------------------------------------------------------------------------------------------------------ // | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | // | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 | @@ -167,19 +217,19 @@ // | | | [ | ] | | { | } | | | // | | | | | | | | | | // | | | | | | | | | | - - bindings = < -&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 -&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp F12 -&trans &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp PIPE -&trans &trans &kp LBKT &kp RBKT &kp LBRC &kp RBRC &trans &trans &trans &trans &trans &trans - &trans &trans &trans &trans - >; - }; - - symbol_layer { - label = "SYMBOL"; - + + bindings = < +&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 +&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp F12 +&trans &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp KP_MULTIPLY &kp LPAR &kp RPAR &kp PIPE +&trans &trans &kp LBKT &kp RBKT &kp LBRC &kp RBRC &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans + >; + }; + + symbol_layer { + label = "SYMBOL"; + // ------------------------------------------------------------------------------------------------------------ // |BTCLR| BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | BTCLR | // | | INS | PSCR | GUI | | | | PGUP | | ^ | | | | @@ -187,19 +237,19 @@ // | | UNDO | CUT | COPY |PASTE | | | | | | // | | | | | | // | | | | | | - - 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 &bt BT_CLR -&trans &kp INS &kp PSCRN &kp K_CMENU &trans &trans &kp PG_UP &trans &kp UP &trans &kp N0 &trans -&trans &kp LALT &kp LCTRL &kp LSHFT &trans &kp CLCK &kp PG_DN &kp LEFT &kp DOWN &kp RIGHT &kp DEL &kp BSPC -&kp K_UNDO &kp K_CUT &kp K_COPY &kp K_PASTE &trans &trans &trans &trans &trans &trans &trans &trans - &trans &trans &trans &trans - >; - }; - - hotkey_layer { - label = "HOTKEY"; - + + 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 &bt BT_CLR +&trans &kp INS &kp PSCRN &kp K_CMENU &trans &trans &kp PG_UP &trans &kp UP &trans &kp N0 &trans +&trans &kp LALT &kp LCTRL &kp LSHFT &trans &kp CLCK &kp PG_DN &kp LEFT &kp DOWN &kp RIGHT &kp DEL &kp BSPC +&kp K_UNDO &kp K_CUT &kp K_COPY &kp K_PASTE &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans + >; + }; + + hotkey_layer { + label = "HOTKEY"; + // ------------------------------------------------------------------------------------------------------------ // |BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | 7 | 8 | 9 | | BTCLR | // | |RGB减色 |RGB增色|RGB减饱|RGB增饱 |RGB特效| | | 4 | 5 | 6 | | | @@ -207,44 +257,44 @@ // | | | | |RGB开关| | | | 0 | . | // | | | | | | // | | | | | | - - bindings = < -&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &ext_power EP_TOG &kp N7 &kp N8 &kp N9 &none &bt BT_CLR -&none &rgb_ug RGB_HUD &rgb_ug RGB_HUI &rgb_ug RGB_SAD &rgb_ug RGB_SAI &rgb_ug RGB_EFF &none &kp N4 &kp N5 &kp N6 &none &none -&none &rgb_ug RGB_BRD &rgb_ug RGB_BRI &none &none &none &none &kp N1 &kp N2 &kp N3 &none &none -&none &none &none &rgb_ug RGB_TOG &none &none &kp N0 &kp DOT &none &none &none &none - &none &none &none &none - >; - }; - - layer_4 { - 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 - >; - }; - - layer_5 { - 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 - >; - }; - - layer_6 { - 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 - >; - }; - }; -}; + + bindings = < +&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &ext_power EP_TOG &kp N7 &kp N8 &kp N9 &none &bt BT_CLR +&none &rgb_ug RGB_HUD &rgb_ug RGB_HUI &rgb_ug RGB_SAD &rgb_ug RGB_SAI &rgb_ug RGB_EFF &none &kp N4 &kp N5 &kp N6 &none &none +&none &rgb_ug RGB_BRD &rgb_ug RGB_BRI &none &none &none &none &kp N1 &kp N2 &kp N3 &none &none +&none &none &none &rgb_ug RGB_TOG &none &none &kp N0 &kp DOT &none &none &none &none + &none &none &none &none + >; + }; + + layer_4 { + 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 + >; + }; + + layer_5 { + 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 + >; + }; + + layer_6 { + 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 + >; + }; + }; +};