From 8b5e492c13f79e4948b558244c49e4ba7fc38f86 Mon Sep 17 00:00:00 2001 From: Zack Forbing Date: Mon, 3 Jun 2024 13:39:23 -0400 Subject: [PATCH] added conditional os layers --- config/alphalpha_plus.keymap | 152 ++++++++++++++++++++++++----------- 1 file changed, 104 insertions(+), 48 deletions(-) diff --git a/config/alphalpha_plus.keymap b/config/alphalpha_plus.keymap index f3f1322..33934ce 100644 --- a/config/alphalpha_plus.keymap +++ b/config/alphalpha_plus.keymap @@ -1,19 +1,7 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include #include #include - -#define ALPHA 0 -#define NUMFN 1 -#define SYMBL 2 -#define NAVVL 3 - -&soft_off { hold-time-ms = <5000>; }; +#include / { combos { @@ -21,7 +9,7 @@ left_enter { bindings = <&kp ENTER>; - key-positions = <1 12 22>; + key-positions = <1 12 23>; }; right_enter { @@ -55,15 +43,15 @@ }; toggle_nav { - bindings = <&tog 2>; + bindings = <&tog 4>; key-positions = <11 2 13>; - layers = <0 2>; + layers = <0 4>; require-prior-idle-ms = <350>; }; jsdoc { bindings = <&jsdoc>; - key-positions = <28 20>; + key-positions = <29 28>; }; caps_lock { @@ -71,9 +59,10 @@ key-positions = <13 12 16 17>; }; - screen_shot { - bindings = <&kp LS(LG(S))>; + screenshot_mac { + bindings = <&kp LS(LG(N5))>; key-positions = <0 11>; + layers = <0 2>; }; reset { @@ -86,9 +75,20 @@ key-positions = <4 14 5 15>; }; - slash_question_mark { - bindings = <&kp SLASH>; - key-positions = <28 27>; + bt_clear_all { + bindings = <&bt BT_CLR_ALL>; + key-positions = <20 21 29 28 22 27>; + }; + + toggle_win { + bindings = <&tog 1>; + key-positions = <0 9>; + }; + + screenshot_win { + bindings = <&kp LS(LG(S))>; + key-positions = <0 11>; + layers = <1>; }; }; @@ -99,10 +99,10 @@ bindings = <&kp>, <&kp>; #binding-cells = <2>; - tapping-term-ms = <300>; + tapping-term-ms = <250>; quick-tap-ms = <0>; flavor = "balanced"; - require-prior-idle-ms = <250>; + require-prior-idle-ms = <200>; }; hs: HOMEROW_SHIFT { @@ -114,7 +114,24 @@ tapping-term-ms = <250>; quick-tap-ms = <0>; flavor = "balanced"; - require-prior-idle-ms = <100>; + }; + + esc: esc { + compatible = "zmk,behavior-tap-dance"; + label = "ESC"; + #binding-cells = <0>; + bindings = <&kp Q>, <&kp ESC>; + + tapping-term-ms = <200>; + }; + + tab: tab { + compatible = "zmk,behavior-tap-dance"; + label = "TAB"; + #binding-cells = <0>; + bindings = <&mt LCTRL ENTER>, <&kp TAB>; + + tapping-term-ms = <250>; }; }; @@ -126,46 +143,85 @@ label = "JSDOC"; }; }; -}; -/ { keymap { compatible = "zmk,keymap"; - ALPHA { + Base { + bindings = < +&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P +&hm LCTRL A &hm LEFT_ALT S &hm LEFT_GUI D &hs LEFT_SHIFT F &kp G &kp H &hs RSHFT J &hm RGUI K &hm RIGHT_ALT L &hm RCTRL SQT +&hs LSHFT Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &hs RSHFT FSLH + < 4 TAB < 2 SPACE < 4 BACKSPACE < 2 DELETE + >; + }; + + Base_win { bindings = < -&kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P -&hm LGUI A &hm LALT S &hm LCTRL D &hs LSHIFT F &kp G &kp H &hs RSHIFT J &hm RCTRL K &hm RALT L &hm RIGHT_GUI SINGLE_QUOTE -&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT -< 2 TAB < 1 SPACE < 2 BACKSPACE < 1 DELETE +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&hm LGUI A &trans &hm LCTRL D &trans &trans &trans &trans &hm RCTRL K &trans &hm RGUI SQT +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans >; }; - NUMSYM { + Num+Sym { bindings = < -&kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp UNDER &kp PLUS &kp TILDE -&hm LEFT_GUI NUMBER_6 &hm LEFT_ALT N7 &hm LCTRL N8 &hm LSHFT N9 &kp N0 &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp MINUS &kp EQUAL &kp GRAVE -&kp KP_PLUS &kp KP_MINUS &kp KP_MULTIPLY &kp KP_DIVIDE &kp KP_DOT &kp LEFT_BRACE &kp RIGHT_BRACE &kp SEMI &kp COLON -&kp LS(TAB) &trans &kp LGUI &trans +&kp NUMBER_1 &kp NUMBER_2 &kp NUMBER_3 &kp NUMBER_4 &kp N5 &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp UNDERSCORE &kp PLUS &kp TILDE +&hm LCTRL N6 &hm LEFT_ALT N7 &hm LGUI N8 &hs LSHFT N9 &kp N0 &kp LEFT_BRACKET &hm RIGHT_SHIFT RIGHT_BRACKET &hm RGUI MINUS &hm RIGHT_ALT EQUAL &hm RCTRL GRAVE +&kp KP_PLUS &kp KP_MINUS &kp KP_MULTIPLY &kp KP_DIVIDE &kp KP_DOT &kp LEFT_BRACE &kp RIGHT_BRACE &kp SEMI &kp COLON &kp BACKSLASH + < 6 LS(TAB) &trans < 6 TAB &trans >; }; - NAVFUN { + Num+Sym_win { bindings = < -&mt LEFT_SHIFT PG_UP &mt LEFT_ALT HOME &mt LCTRL UP &mt LEFT_ALT END &kp LA(LC(LS(BACKSLASH))) &trans &kp F9 &kp F10 &kp F11 &kp F12 -&mt LCTRL PG_DN &kp LEFT &kp DOWN &kp RIGHT &kp BACKSPACE &kp DELETE &hm RSHFT F5 &hm RCTRL F6 &hm RALT F7 &hm RIGHT_GUI F8 -&kp LC(Z) &kp LC(X) &kp LC(C) &kp LC(V) &kp LS(LC(K)) &kp F1 &kp F2 &kp F3 &kp F4 -&trans &trans &trans &trans +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&hm LGUI NUMBER_6 &trans &hm LCTRL N8 &trans &trans &trans &trans &hm RCTRL MINUS &trans &hm RGUI GRAVE +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans >; }; - MISC { + Nav+Func { bindings = < -&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_DISC 0 &bt BT_DISC 1 &bt BT_DISC 2 &bt BT_DISC 3 &bt BT_DISC 4 &trans &trans &trans &trans &trans -&bt BT_CLR &trans &trans &trans &trans &trans &trans &trans &bt BT_CLR_ALL -&trans &trans &trans &trans +&mt LEFT_SHIFT PAGE_UP &kp HOME &mt LS(LALT) UP_ARROW &kp END &kp LS(LA(LC(BACKSLASH))) &trans &kp F9 &kp F10 &kp F11 &kp F12 +&mt LALT PAGE_DOWN &kp LEFT &kp DOWN &kp RIGHT &kp BACKSPACE &kp DELETE &hs RSHFT F5 &hm RGUI F6 &hm LEFT_ALT F7 &hm RCTRL F8 +&kp LG(Z) &kp LG(X) &kp LG(C) &kp LG(V) &kp LS(LG(K)) &trans &kp F1 &kp F2 &kp F3 &kp F4 + &trans < 6 LCTRL &trans < 6 TAB >; }; + + Nav+Func_win { + bindings = < +&trans &mt LALT HOME &trans &mt LALT END &trans &trans &trans &trans &trans &trans +&hm LCTRL PAGE_DOWN &trans &trans &trans &trans &trans &trans &hm RCTRL F6 &trans &hm RGUI F8 +&kp LC(Z) &kp LC(X) &kp LC(C) &kp LC(V) &kp LS(LC(K)) &trans &trans &trans &trans &trans + &trans &trans &trans &trans + >; + }; + + Bluetooth { + bindings = < +&bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &bt BT_CLR_ALL +&bt BT_DISC 0 &bt BT_DISC 1 &bt BT_DISC 2 &bt BT_DISC 3 &bt BT_DISC 4 &trans &trans &trans &trans &trans +&bt BT_CLR &trans &out OUT_TOG &trans &sys_reset &bootloader &trans &trans &trans &trans + &trans &trans &trans &trans + >; + }; + }; + + conditional_layers { + compatible = "zmk,conditional-layers"; + + num_sym_win { + if-layers = <1 2>; + then-layer = <3>; + }; + + nav_func_win { + if-layers = <1 4>; + then-layer = <5>; + }; }; -}; \ No newline at end of file +};