From 21d78f7467c8895907f8589451adffe490996138 Mon Sep 17 00:00:00 2001 From: Sviatoslav Bulbakha Date: Sun, 10 Dec 2023 03:44:29 +0400 Subject: [PATCH] Use callum-style layers --- config/3x5_2.keymap | 87 +++++++++++++++++--- config/hyperpotato.conf | 4 +- keymap-drawer/3x5_2.svg | 170 ++++++++++++++++++++++----------------- keymap-drawer/3x5_2.yaml | 66 ++++++++------- 4 files changed, 208 insertions(+), 119 deletions(-) diff --git a/config/3x5_2.keymap b/config/3x5_2.keymap index 0f745fe..090de85 100644 --- a/config/3x5_2.keymap +++ b/config/3x5_2.keymap @@ -10,10 +10,21 @@ #include #include + /* ╭────────────────────┬────────────────────╮ */ + /* │ 0 1 2 3 4 │ 5 6 7 8 9 │ */ + /* │ 10 11 12 13 14 │ 15 16 17 18 19 │ */ + /* │ 20 21 22 23 24 │ 25 26 27 28 29 │ */ + /* ╰───────────╮ 30 31 │ 32 33 ╭───────────╯ */ + /* ╰────────┴────────╯ */ + +#define KEYS_L 0 1 2 3 4 10 11 12 13 14 20 21 22 23 24 +#define KEYS_R 5 6 7 8 9 15 16 17 18 19 25 26 27 28 29 +#define THUMBS 30 31 32 33 + #define DEF 0 #define EXT 1 #define SYM 2 -#define SYM2 3 +#define NUM 3 #define FUN 4 #define PREV LG(LS(LBKT)) @@ -26,6 +37,15 @@ #define BRI_UP LC(C_BRI_UP) #define BRI_DN LC(C_BRI_DN) +#define COMBO(NAME, BINDINGS, KEYPOS) \ + combo_##NAME { \ + timeout-ms = <50>; \ + bindings = ; \ + key-positions = ; \ + layers = <0>; \ + require-prior-idle-ms = <150>; \ + }; + &sk { release-after-ms = <1000>; quick-release; @@ -38,6 +58,11 @@ }; / { + combos { + compatible = "zmk,combos"; + COMBO(esc, &kp ESC, 1 3) + }; + behaviors { smart_shift: smart_shift { compatible = "zmk,behavior-mod-morph"; @@ -54,6 +79,41 @@ bindings = <&mo SYM>, <&mo FUN>; mods = <(MOD_RSFT)>; }; + + swapper: swapper { + label = "SWAPPER"; + compatible = "zmk,behavior-tri-state"; + #binding-cells = <0>; + bindings = <&kt LGUI>, <&kp TAB>, <&kt LGUI>; + ignored-key-positions = <2>; + }; + + hml: hml { + label = "HML"; + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + quick-tap-ms = <175>; + require-prior-idle-ms = <150>; + bindings = <&kp>, <&kp>; + hold-trigger-key-positions = ; + hold-trigger-on-release; + }; + + hmr: hmr { + label = "HMR"; + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + quick-tap-ms = <175>; + require-prior-idle-ms = <140>; + bindings = <&kp>, <&kp>; + hold-trigger-key-positions = ; + hold-trigger-on-release; + }; + }; conditional_layers { @@ -61,7 +121,7 @@ fun_tri_layer { if-layers = <1 2>; - then-layer = <3>; + then-layer = <4>; }; }; @@ -72,9 +132,10 @@ label = "DEF"; bindings = < &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp SQT + /* &hml LALT A &hml LGUI R &hml LSFT S &hml LCTL T &kp G &kp M &hmr LCTL N &hmr LSFT E &hmr LGUI I &hmr LALT O */ &kp A &kp R &kp S &kp T &kp G &kp M &kp N &kp E &kp I &kp O &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &kp COMMA &kp DOT &kp FSLH - &smart_shift &mo EXT &kp SPACE &sym_fun + &mo EXT &kp RSFT &kp SPACE &sym_fun >; }; @@ -83,7 +144,7 @@ bindings = < &kp ESC &kp PREV &kp LG(F) &kp NEXT &key_repeat &kp PG_UP &kp HOME &kp UP &kp END &kp CAPS &sk LALT &sk LGUI &sk LSFT &sk LCTL &kp LC(G) &kp PG_DN &kp LEFT &kp DOWN &kp RIGHT &kp DEL - &kp RG(Z) &kp RG(X) &kp RG(C) &kp TAB &kp RG(V) &kp LA(BSPC) &kp BSPC &kp TAB &none &none + &kp RG(Z) &kp RG(X) &kp RG(C) &kp TAB &kp RG(V) &kp LA(BSPC) &kp BSPC &kp LC(T) &none &none &trans &trans &kp RET &trans >; }; @@ -91,19 +152,19 @@ sym_layer { label = "SYM"; bindings = < - &kp N7 &kp N5 &kp N3 &kp N1 &kp N9 &kp N8 &kp N0 &kp N2 &kp N4 &kp N6 - &kp PRCNT &kp EQUAL &kp COLON &kp UNDER &kp PIPE &kp LBKT &kp LPAR &kp LBRC &kp LT &kp SEMI - &kp PLUS &kp MINUS &kp AMPS &kp AT &kp CARET &kp RBKT &kp RPAR &kp RBRC &kp GT &kp BSLH - &mo FUN &trans &trans &trans + &kp EXCL &kp EQUAL &kp LBRC &kp LPAR &kp LBKT &kp RBKT &kp RPAR &kp RBRC &kp SEMI &kp STAR + &kp PRCNT &kp MINUS &kp COLON &kp UNDER &kp PIPE &kp HASH &sk LCTL &sk LSFT &sk LGUI &sk LALT + &kp PLUS &kp AMPS &kp CARET &kp AT &kp TILDE &kp DLLR &kp GRAVE &kp LT &kp GT &kp BSLH + &trans &mo NUM &trans &trans >; }; - sym2_layer { - label = "SYM2"; + num_layer { + label = "NUM"; bindings = < + &kp N7 &kp N5 &kp N3 &kp N1 &kp N9 &kp N8 &kp N0 &kp N2 &kp N4 &kp N6 + &sk LALT &sk LGUI &sk LSFT &sk LCTL &kp F11 &kp F10 &sk LCTL &sk LSFT &sk LGUI &sk LALT &kp F7 &kp F5 &kp F3 &kp F1 &kp F9 &kp F8 &kp F12 &kp F2 &kp F4 &kp F6 - &kp DLLR &kp STAR &kp HASH &kp EXCL &kp F11 &kp F10 &trans &trans &trans &none - &none &none &kp TILDE &kp GRAVE &none &none &trans &trans &trans &none &trans &trans &trans &trans >; }; @@ -112,7 +173,7 @@ label = "FUN"; bindings = < &none &kp C_PREV &kp C_PP &kp C_NEXT &kp BRI_UP &kp ZOOM_IN &bt BT_PRV &bt BT_CLR &bt BT_NXT &none - &none &kp C_VOL_DN &kp C_MUTE &kp C_VOL_UP &kp BRI_DN &kp ZOOM_OUT &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &none + &none &kp C_VOL_DN &kp C_MUTE &kp C_VOL_UP &kp BRI_DN &kp ZOOM_OUT &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &out OUT_TOG &none &none &none &none &none &kp ZOOM_RES &none &none &none &none &none &trans &trans &trans >; diff --git a/config/hyperpotato.conf b/config/hyperpotato.conf index a6add88..2bca63e 100644 --- a/config/hyperpotato.conf +++ b/config/hyperpotato.conf @@ -11,5 +11,5 @@ CONFIG_ZMK_WIDGET_BATTERY_STATUS_SHOW_PERCENTAGE=y CONFIG_ZMK_EXT_POWER=n -CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=5 -CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=10 +# CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=5 +# CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=10 diff --git a/keymap-drawer/3x5_2.svg b/keymap-drawer/3x5_2.svg index 3b52920..c73ace4 100644 --- a/keymap-drawer/3x5_2.svg +++ b/keymap-drawer/3x5_2.svg @@ -392,13 +392,11 @@ path.combo { -RSFT -sticky -Caps Word +EXT -EXT +RSFT @@ -409,6 +407,12 @@ path.combo { SYM FUN + + + + +Esc + @@ -537,8 +541,7 @@ path.combo { - -Tab +LC(T) @@ -546,13 +549,13 @@ path.combo { - + + + + - - - @@ -568,43 +571,43 @@ path.combo { -7 +! -5 += -3 +{ -1 +( -9 +[ -8 +] -0 +) -2 +} -4 +; -6 +* @@ -612,7 +615,7 @@ path.combo { -= +- @@ -628,23 +631,27 @@ path.combo { -[ +# -( + +sticky -{ + +sticky -< + +sticky -; + +sticky @@ -652,11 +659,11 @@ path.combo { -- +& -& +^ @@ -664,19 +671,19 @@ path.combo { -^ +~ -] +$ -) +` -} +< @@ -686,14 +693,14 @@ path.combo { \ - - -FUN - - + + + +NUM + @@ -703,64 +710,68 @@ path.combo { - -SYM2 + +NUM -F7 +7 -F5 +5 -F3 +3 -F1 +1 -F9 +9 -F8 +8 -F12 +0 -F2 +2 -F4 +4 -F6 +6 -$ + +sticky -* + +sticky -# + +sticky -! + +sticky @@ -770,55 +781,65 @@ path.combo { F10 - - - + + + +sticky - - - + + + +sticky - - - + + + +sticky + +sticky +F7 +F5 -~ +F3 -` +F1 +F9 +F8 - - - + + +F12 - - - + + +F2 - - - + + +F4 +F6 @@ -928,6 +949,9 @@ path.combo { + +OUTTOG + diff --git a/keymap-drawer/3x5_2.yaml b/keymap-drawer/3x5_2.yaml index 57c5ce8..88fcbcc 100644 --- a/keymap-drawer/3x5_2.yaml +++ b/keymap-drawer/3x5_2.yaml @@ -3,8 +3,8 @@ layers: - [Q, W, F, P, B, J, L, U, Y, ''''] - [A, R, S, T, G, M, N, E, I, O] - [Z, X, C, D, V, K, H, ',', ., /] - - - {t: RSFT, h: sticky, s: Caps Word} - - EXT + - - EXT + - RSFT - $$mdi:keyboard-space$$ - {t: SYM, s: FUN} EXT: @@ -35,43 +35,43 @@ layers: - Paste - {t: '$$mdi:backspace-outline$$', h: Word} - {t: '$$mdi:backspace-outline$$', h: Bspc} - - {t: '$$mdi:keyboard-tab$$', h: Tab} + - LC(T) - '' - '' - - - {t: ▽, type: trans} - - {type: held} + - - {type: held} + - {t: ▽, type: trans} - $$mdi:keyboard-return$$ - {t: ▽, type: trans} SYM: - - ['7', '5', '3', '1', '9', '8', '0', '2', '4', '6'] - - ['%', '=', ':', _, '|', '[', (, '{', <, ;] - - [+, '-', '&', '@', ^, ']', ), '}', '>', \] - - - FUN - - {t: ▽, type: trans} + - ['!', '=', '{', (, '[', ']', ), '}', ;, '*'] + - - '%' + - '-' + - ':' + - _ + - '|' + - '#' + - {t: '$$mdi:apple-keyboard-control$$', h: sticky} + - {t: '$$mdi:apple-keyboard-shift$$', h: sticky} + - {t: '$$mdi:apple-keyboard-command$$', h: sticky} + - {t: '$$mdi:apple-keyboard-option$$', h: sticky} + - [+, '&', ^, '@', '~', $, '`', <, '>', \] + - - {t: ▽, type: trans} + - NUM - {t: ▽, type: trans} - {type: held} - SYM2: - - [F7, F5, F3, F1, F9, F8, F12, F2, F4, F6] - - - $ - - '*' - - '#' - - '!' + NUM: + - ['7', '5', '3', '1', '9', '8', '0', '2', '4', '6'] + - - {t: '$$mdi:apple-keyboard-option$$', h: sticky} + - {t: '$$mdi:apple-keyboard-command$$', h: sticky} + - {t: '$$mdi:apple-keyboard-shift$$', h: sticky} + - {t: '$$mdi:apple-keyboard-control$$', h: sticky} - F11 - F10 - - {t: ▽, type: trans} - - {t: ▽, type: trans} - - {t: ▽, type: trans} - - '' - - - '' - - '' - - '~' - - '`' - - '' - - '' - - {t: ▽, type: trans} - - {t: ▽, type: trans} - - {t: ▽, type: trans} - - '' + - {t: '$$mdi:apple-keyboard-control$$', h: sticky} + - {t: '$$mdi:apple-keyboard-shift$$', h: sticky} + - {t: '$$mdi:apple-keyboard-command$$', h: sticky} + - {t: '$$mdi:apple-keyboard-option$$', h: sticky} + - [F7, F5, F3, F1, F9, F8, F12, F2, F4, F6] - - {t: ▽, type: trans} - {type: held} - {t: ▽, type: trans} @@ -96,9 +96,13 @@ layers: - {t: '$$tabler:bluetooth$$', h: '1'} - {t: '$$tabler:bluetooth$$', h: '2'} - {t: '$$tabler:bluetooth$$', h: '3'} - - '' + - OUT TOG - ['', '', '', '', '', LG(0), '', '', '', ''] - - '' - {t: ▽, type: trans} - {t: ▽, type: trans} - {type: held} +combos: +- p: [1, 3] + k: Esc + l: [DEF]