diff options
author | Alexander Krikun <[email protected]> | 2024-10-07 02:58:41 +0400 |
---|---|---|
committer | Pete Johanson <[email protected]> | 2024-10-16 17:04:39 -0600 |
commit | 218a2fff8dddd664ccb9288c176246f5c85d9969 (patch) | |
tree | 471e5c61e3c38fb7326438fb8dba2ca4902e7764 | |
parent | bbe4f64bb297964fdac9bd00467e334a45729d2b (diff) | |
download | zmk-218a2fff8dddd664ccb9288c176246f5c85d9969.tar.gz zmk-218a2fff8dddd664ccb9288c176246f5c85d9969.zip |
feat(shields): add physical layouts and update keymap for Jian
Add physical layouts and update the keymap for King of Hedgehogs' Jian.
Layouts are added for all three possible transforms:
- Full (with additional pinky key)
- 6 column (Corne)
- 5 column (Minidox)
The layouts are added to be re-usable for the Jiran and other custom boards/shields.
Keymap update includes, small guide clarifications, output selection,
tri-layer and &studio_unlock.
-rw-r--r-- | app/boards/shields/jian/jian.dtsi | 20 | ||||
-rw-r--r-- | app/boards/shields/jian/jian.keymap | 37 | ||||
-rw-r--r-- | app/dts/layouts/kgoh/jian/5column.dtsi | 59 | ||||
-rw-r--r-- | app/dts/layouts/kgoh/jian/6column.dtsi | 65 | ||||
-rw-r--r-- | app/dts/layouts/kgoh/jian/full.dtsi | 67 | ||||
-rw-r--r-- | app/dts/layouts/kgoh/jian/position_map.dtsi | 7 |
6 files changed, 241 insertions, 14 deletions
diff --git a/app/boards/shields/jian/jian.dtsi b/app/boards/shields/jian/jian.dtsi index 439bf93c05..4045b6b3ab 100644 --- a/app/boards/shields/jian/jian.dtsi +++ b/app/boards/shields/jian/jian.dtsi @@ -6,10 +6,26 @@ #include <dt-bindings/zmk/matrix_transform.h> +#include <layouts/kgoh/jian/full.dtsi> +#include <layouts/kgoh/jian/6column.dtsi> +#include <layouts/kgoh/jian/5column.dtsi> + +&kgoh_jian_full_layout { + transform = <&default_transform>; +}; + +&kgoh_jian_6col_layout { + transform = <&crkbd_transform>; +}; + +&kgoh_jian_5col_layout { + transform = <&five_column_transform>; +}; + / { chosen { zmk,kscan = &kscan0; - zmk,matrix-transform = &default_transform; + zmk,physical-layout = &kgoh_jian_full_layout; }; default_transform: keymap_transform_0 { @@ -56,7 +72,7 @@ RC(0,1) RC(1,2) RC(0,2) RC(0,3) RC(0,4) RC(0,7) RC(0,8) RC(0,9) RC(1,9) RC(0,10) RC(1,1) RC(2,2) RC(1,3) RC(1,4) RC(0,5) RC(0,6) RC(1,7) RC(1,8) RC(2,9) RC(1,10) RC(3,2) RC(3,3) RC(2,3) RC(2,4) RC(1,5) RC(1,6) RC(2,7) RC(2,8) RC(3,8) RC(3,9) - RC(3,4) RC(2,5) RC(3,5) RC(3,6) RC(2,6) RC(3,7) + RC(3,4) RC(2,5) RC(3,5) RC(3,6) RC(2,6) RC(3,7) >; }; diff --git a/app/boards/shields/jian/jian.keymap b/app/boards/shields/jian/jian.keymap index b0235bd7ec..72d4bde8b8 100644 --- a/app/boards/shields/jian/jian.keymap +++ b/app/boards/shields/jian/jian.keymap @@ -7,6 +7,7 @@ #include <behaviors.dtsi> #include <dt-bindings/zmk/keys.h> #include <dt-bindings/zmk/bt.h> +#include <dt-bindings/zmk/outputs.h> #define DEF 0 #define LWR 1 @@ -17,60 +18,72 @@ &mt { quick-tap-ms = <200>; }; / { + conditional_layers { + compatible = "zmk,conditional-layers"; + tri_layer { + if-layers = <LWR RSE>; + then-layer = <ADJ>; + }; + }; + keymap { compatible = "zmk,keymap"; default_layer { + display-name = "MAIN"; // ----------------------------------------------------------------------------------------- // | GUI | ~ | Q | W | E | R | T | | Y | U | I | O | P | [ | GUI/] | // | CTRL | A | S | D | F | G | | H | J | K | L | ; |CTRL/'| -// | LALT | Z | X | C | V | B | | N | M | , | . | / | RALT | +// | LALT | Z | X | C | V | B | | N | M | , | . | / |RALT/\| // | RSE | SPC | LWR | | LWR | BSPC | RSE | bindings = < &kp LWIN &kp GRAVE &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &mt RWIN RBKT &kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &mt RCTRL SQT &kp LALT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &mt RALT BSLH - < RSE TAB &mt LSHFT SPACE < LWR RET < LWR ESC &mt RSHFT BSPC < RSE DEL + < RSE TAB &mt LSHFT SPACE < LWR RET < LWR ESC &mt RSHFT BSPC < RSE DEL >; }; lower_layer { + display-name = "SYM"; // ----------------------------------------------------------------------------------------- // | | _ | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | F12 | // | + | ! | @ | # | $ | % | | ^ | & | * | ( | ) | - | // | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | -// | GUI | | SPC | | ENT | | ALT | +// | ADJ | | | | | | ADJ | bindings = < &trans &kp UNDER &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &mt RGUI F12 &mt LCTRL PLUS &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp STAR &kp LPAR &kp RPAR &mt RCTRL MINUS &mt LALT EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans - < ADJ TAB &trans &trans &trans &trans < ADJ DEL + &trans &trans &trans &trans &trans &trans >; }; raise_layer { + display-name = "NUM"; // ----------------------------------------------------------------------------------------- // | | NMLK | / | 7 | 8 | 9 | - | | VOLU| HOME| PRSC| PGUP| SCLK| CLCK| | -// | CTRL | * | 4 | 5 | 6 | + | | MUT | LEFT| UP | RGHT| INS | APP | +// |CTRL/=| * | 4 | 5 | 6 | + | | MUT | LEFT| UP | RGHT| INS | APP | // | | 0 | 1 | 2 | 3 | . | | VOLD| END | DOWN| PGDN| PAUS| | // | | | ADJ | | ADJ | | | bindings = < &trans &kp KP_NUM &kp KP_SLASH &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp C_VOL_UP &kp HOME &kp PSCRN &kp PG_UP &kp SLCK &kp CAPS &trans &mt LCTRL EQUAL &kp KP_MULTIPLY &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp C_MUTE &kp LEFT &kp UP &kp RIGHT &kp INS &mt RCTRL K_APP &trans &kp KP_N0 &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_DOT &kp C_VOL_DN &kp END &kp DOWN &kp PG_DN &kp PAUSE_BREAK &trans - &trans &trans < ADJ RET < ADJ ESC &trans &trans + &trans &trans &trans &trans &trans &trans >; }; adjust_layer { + display-name = "ADJ"; // ----------------------------------------------------------------------------------------- -// | RST | BLDR | | | | | | | | | | | | BLDR | RST | +// | RST | BLDR | STU | | | | | | | | | | STU | BLDR | RST | // | BTCLR| BT0 | BT1 | BT2 | BT3 | BT4 | | BT4 | BT3 | BT2 | BT1 | BT0 | BTCLR| -// | | | | | | | | | | | | | | +// | OUT | | | | | | | | | | | | OUT | // | | | | | | | | bindings = < - &sys_reset &bootloader &none &none &none &none &none &none &none &none &none &none &bootloader &sys_reset - &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_SEL 4 &bt BT_SEL 3 &bt BT_SEL 2 &bt BT_SEL 1 &bt BT_SEL 0 &bt BT_CLR - &none &none &none &none &none &none &none &none &none &none &none &none - &trans &none &trans &trans &none &trans + &sys_reset &bootloader &studio_unlock &none &none &none &none &none &none &none &none &studio_unlock &bootloader &sys_reset + &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_SEL 4 &bt BT_SEL 3 &bt BT_SEL 2 &bt BT_SEL 1 &bt BT_SEL 0 &bt BT_CLR + &out OUT_TOG &none &none &none &none &none &none &none &none &none &none &out OUT_TOG + &trans &none &trans &trans &none &trans >; }; }; diff --git a/app/dts/layouts/kgoh/jian/5column.dtsi b/app/dts/layouts/kgoh/jian/5column.dtsi new file mode 100644 index 0000000000..c54d07fd9a --- /dev/null +++ b/app/dts/layouts/kgoh/jian/5column.dtsi @@ -0,0 +1,59 @@ +#include <layouts/kgoh/jian/position_map.dtsi> +#include <physical_layouts.dtsi> + +/ { + kgoh_jian_5col_layout: kgoh_jian_5col_layout { + compatible = "zmk,physical-layout"; + display-name = "5 Column"; + + keys // w h x y rot rx ry + = <&key_physical_attrs 100 100 0 62 0 0 0> + , <&key_physical_attrs 100 100 100 25 0 0 0> + , <&key_physical_attrs 100 100 200 0 0 0 0> + , <&key_physical_attrs 100 100 300 25 0 0 0> + , <&key_physical_attrs 100 100 400 37 0 0 0> + , <&key_physical_attrs 100 100 800 37 0 0 0> + , <&key_physical_attrs 100 100 900 25 0 0 0> + , <&key_physical_attrs 100 100 1000 0 0 0 0> + , <&key_physical_attrs 100 100 1100 25 0 0 0> + , <&key_physical_attrs 100 100 1200 62 0 0 0> + , <&key_physical_attrs 100 100 0 162 0 0 0> + , <&key_physical_attrs 100 100 100 125 0 0 0> + , <&key_physical_attrs 100 100 200 100 0 0 0> + , <&key_physical_attrs 100 100 300 125 0 0 0> + , <&key_physical_attrs 100 100 400 137 0 0 0> + , <&key_physical_attrs 100 100 800 137 0 0 0> + , <&key_physical_attrs 100 100 900 125 0 0 0> + , <&key_physical_attrs 100 100 1000 100 0 0 0> + , <&key_physical_attrs 100 100 1100 125 0 0 0> + , <&key_physical_attrs 100 100 1200 162 0 0 0> + , <&key_physical_attrs 100 100 0 262 0 0 0> + , <&key_physical_attrs 100 100 100 225 0 0 0> + , <&key_physical_attrs 100 100 200 200 0 0 0> + , <&key_physical_attrs 100 100 300 225 0 0 0> + , <&key_physical_attrs 100 100 400 237 0 0 0> + , <&key_physical_attrs 100 100 800 237 0 0 0> + , <&key_physical_attrs 100 100 900 225 0 0 0> + , <&key_physical_attrs 100 100 1000 200 0 0 0> + , <&key_physical_attrs 100 100 1100 225 0 0 0> + , <&key_physical_attrs 100 100 1200 262 0 0 0> + , <&key_physical_attrs 100 100 300 325 0 0 0> + , <&key_physical_attrs 100 100 400 337 0 0 0> + , <&key_physical_attrs 100 100 500 350 0 0 0> + , <&key_physical_attrs 100 100 700 350 0 0 0> + , <&key_physical_attrs 100 100 800 337 0 0 0> + , <&key_physical_attrs 100 100 900 325 0 0 0> + ; + }; +}; + +&layouts_kgoh_jian_position_map { + kgoh_jian_5col_posmap: five { + physical-layout = <&kgoh_jian_5col_layout>; + positions + = <36 37 0 1 2 3 4 5 6 7 8 9 38 39> + , < 40 10 11 12 13 14 15 16 17 18 19 41 > + , < 42 20 21 22 23 24 25 26 27 28 29 43 > + , < 30 31 32 33 34 35 >; + }; +}; diff --git a/app/dts/layouts/kgoh/jian/6column.dtsi b/app/dts/layouts/kgoh/jian/6column.dtsi new file mode 100644 index 0000000000..ec648846e6 --- /dev/null +++ b/app/dts/layouts/kgoh/jian/6column.dtsi @@ -0,0 +1,65 @@ +#include <layouts/kgoh/jian/position_map.dtsi> +#include <physical_layouts.dtsi> + +/ { + kgoh_jian_6col_layout: kgoh_jian_6col_layout { + compatible = "zmk,physical-layout"; + display-name = "6 Column"; + + keys // w h x y rot rx ry + = <&key_physical_attrs 100 100 0 75 0 0 0> + , <&key_physical_attrs 100 100 100 62 0 0 0> + , <&key_physical_attrs 100 100 200 25 0 0 0> + , <&key_physical_attrs 100 100 300 0 0 0 0> + , <&key_physical_attrs 100 100 400 25 0 0 0> + , <&key_physical_attrs 100 100 500 37 0 0 0> + , <&key_physical_attrs 100 100 900 37 0 0 0> + , <&key_physical_attrs 100 100 1000 25 0 0 0> + , <&key_physical_attrs 100 100 1100 0 0 0 0> + , <&key_physical_attrs 100 100 1200 25 0 0 0> + , <&key_physical_attrs 100 100 1300 62 0 0 0> + , <&key_physical_attrs 100 100 1400 75 0 0 0> + , <&key_physical_attrs 100 100 0 175 0 0 0> + , <&key_physical_attrs 100 100 100 162 0 0 0> + , <&key_physical_attrs 100 100 200 125 0 0 0> + , <&key_physical_attrs 100 100 300 100 0 0 0> + , <&key_physical_attrs 100 100 400 125 0 0 0> + , <&key_physical_attrs 100 100 500 137 0 0 0> + , <&key_physical_attrs 100 100 900 137 0 0 0> + , <&key_physical_attrs 100 100 1000 125 0 0 0> + , <&key_physical_attrs 100 100 1100 100 0 0 0> + , <&key_physical_attrs 100 100 1200 125 0 0 0> + , <&key_physical_attrs 100 100 1300 162 0 0 0> + , <&key_physical_attrs 100 100 1400 175 0 0 0> + , <&key_physical_attrs 100 100 0 275 0 0 0> + , <&key_physical_attrs 100 100 100 262 0 0 0> + , <&key_physical_attrs 100 100 200 225 0 0 0> + , <&key_physical_attrs 100 100 300 200 0 0 0> + , <&key_physical_attrs 100 100 400 225 0 0 0> + , <&key_physical_attrs 100 100 500 237 0 0 0> + , <&key_physical_attrs 100 100 900 237 0 0 0> + , <&key_physical_attrs 100 100 1000 225 0 0 0> + , <&key_physical_attrs 100 100 1100 200 0 0 0> + , <&key_physical_attrs 100 100 1200 225 0 0 0> + , <&key_physical_attrs 100 100 1300 262 0 0 0> + , <&key_physical_attrs 100 100 1400 275 0 0 0> + , <&key_physical_attrs 100 100 400 325 0 0 0> + , <&key_physical_attrs 100 100 500 337 0 0 0> + , <&key_physical_attrs 100 100 600 350 0 0 0> + , <&key_physical_attrs 100 100 800 350 0 0 0> + , <&key_physical_attrs 100 100 900 337 0 0 0> + , <&key_physical_attrs 100 100 1000 325 0 0 0> + ; + }; +}; + +&layouts_kgoh_jian_position_map { + kgoh_jian_6col_posmap: six { + physical-layout = <&kgoh_jian_6col_layout>; + positions + = <42 0 1 2 3 4 5 6 7 8 9 10 11 43> + , < 12 13 14 15 16 17 18 19 20 21 22 23 > + , < 24 25 26 27 28 29 30 31 32 33 34 35 > + , < 36 37 38 39 40 41 >; + }; +}; diff --git a/app/dts/layouts/kgoh/jian/full.dtsi b/app/dts/layouts/kgoh/jian/full.dtsi new file mode 100644 index 0000000000..a16903d3ae --- /dev/null +++ b/app/dts/layouts/kgoh/jian/full.dtsi @@ -0,0 +1,67 @@ +#include <layouts/kgoh/jian/position_map.dtsi> +#include <physical_layouts.dtsi> + +/ { + kgoh_jian_full_layout: kgoh_jian_full_layout { + compatible = "zmk,physical-layout"; + display-name = "Full (with pinky)"; + + keys // w h x y rot rx ry + = <&key_physical_attrs 100 100 0 150 0 0 0> + , <&key_physical_attrs 100 100 100 75 0 0 0> + , <&key_physical_attrs 100 100 200 62 0 0 0> + , <&key_physical_attrs 100 100 300 25 0 0 0> + , <&key_physical_attrs 100 100 400 0 0 0 0> + , <&key_physical_attrs 100 100 500 25 0 0 0> + , <&key_physical_attrs 100 100 600 37 0 0 0> + , <&key_physical_attrs 100 100 1000 37 0 0 0> + , <&key_physical_attrs 100 100 1100 25 0 0 0> + , <&key_physical_attrs 100 100 1200 0 0 0 0> + , <&key_physical_attrs 100 100 1300 25 0 0 0> + , <&key_physical_attrs 100 100 1400 62 0 0 0> + , <&key_physical_attrs 100 100 1500 75 0 0 0> + , <&key_physical_attrs 100 100 1600 150 0 0 0> + , <&key_physical_attrs 100 100 100 175 0 0 0> + , <&key_physical_attrs 100 100 200 162 0 0 0> + , <&key_physical_attrs 100 100 300 125 0 0 0> + , <&key_physical_attrs 100 100 400 100 0 0 0> + , <&key_physical_attrs 100 100 500 125 0 0 0> + , <&key_physical_attrs 100 100 600 137 0 0 0> + , <&key_physical_attrs 100 100 1000 137 0 0 0> + , <&key_physical_attrs 100 100 1100 125 0 0 0> + , <&key_physical_attrs 100 100 1200 100 0 0 0> + , <&key_physical_attrs 100 100 1300 125 0 0 0> + , <&key_physical_attrs 100 100 1400 162 0 0 0> + , <&key_physical_attrs 100 100 1500 175 0 0 0> + , <&key_physical_attrs 100 100 100 275 0 0 0> + , <&key_physical_attrs 100 100 200 262 0 0 0> + , <&key_physical_attrs 100 100 300 225 0 0 0> + , <&key_physical_attrs 100 100 400 200 0 0 0> + , <&key_physical_attrs 100 100 500 225 0 0 0> + , <&key_physical_attrs 100 100 600 237 0 0 0> + , <&key_physical_attrs 100 100 1000 237 0 0 0> + , <&key_physical_attrs 100 100 1100 225 0 0 0> + , <&key_physical_attrs 100 100 1200 200 0 0 0> + , <&key_physical_attrs 100 100 1300 225 0 0 0> + , <&key_physical_attrs 100 100 1400 262 0 0 0> + , <&key_physical_attrs 100 100 1500 275 0 0 0> + , <&key_physical_attrs 100 100 500 325 0 0 0> + , <&key_physical_attrs 100 100 600 337 0 0 0> + , <&key_physical_attrs 100 100 700 350 0 0 0> + , <&key_physical_attrs 100 100 900 350 0 0 0> + , <&key_physical_attrs 100 100 1000 337 0 0 0> + , <&key_physical_attrs 100 100 1100 325 0 0 0> + ; + }; +}; + +&layouts_kgoh_jian_position_map { + kgoh_jian_full_posmap: full { + physical-layout = <&kgoh_jian_full_layout>; + positions + = < 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 34 35 36 37 > + , < 38 39 40 41 42 43 >; + }; +}; diff --git a/app/dts/layouts/kgoh/jian/position_map.dtsi b/app/dts/layouts/kgoh/jian/position_map.dtsi new file mode 100644 index 0000000000..126e0772b0 --- /dev/null +++ b/app/dts/layouts/kgoh/jian/position_map.dtsi @@ -0,0 +1,7 @@ +/ { + layouts_kgoh_jian_position_map: layouts_kgoh_jian_position_map { + compatible = "zmk,physical-layout-position-map"; + + complete; + }; +}; |