Skip to content

Commit

Permalink
added conditional os layers
Browse files Browse the repository at this point in the history
  • Loading branch information
Zack Forbing committed Jun 3, 2024
1 parent d9b02f4 commit 8b5e492
Showing 1 changed file with 104 additions and 48 deletions.
152 changes: 104 additions & 48 deletions config/alphalpha_plus.keymap
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

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

#define ALPHA 0
#define NUMFN 1
#define SYMBL 2
#define NAVVL 3

&soft_off { hold-time-ms = <5000>; };
#include <dt-bindings/zmk/outputs.h>

/ {
combos {
compatible = "zmk,combos";

left_enter {
bindings = <&kp ENTER>;
key-positions = <1 12 22>;
key-positions = <1 12 23>;
};

right_enter {
Expand Down Expand Up @@ -55,25 +43,26 @@
};

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 {
bindings = <&kp CAPSLOCK>;
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 {
Expand All @@ -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>;
};
};

Expand All @@ -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 {
Expand All @@ -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>;
};
};

Expand All @@ -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
&lt 4 TAB &lt 2 SPACE &lt 4 BACKSPACE &lt 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
&lt 2 TAB &lt 1 SPACE &lt 2 BACKSPACE &lt 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
&lt 6 LS(TAB) &trans &lt 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 &lt 6 LCTRL &trans &lt 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>;
};
};
};
};

0 comments on commit 8b5e492

Please sign in to comment.