Skip to content

Commit

Permalink
feat(shields): add physical layouts and update keymap for Jiran
Browse files Browse the repository at this point in the history
Add physical layouts and update the keymap for Ladniy's Jiran.
Layouts are added for all three possible transforms:
- Full (with additional pinky key and number row)
- Jian (with additional pinky key), re-uses Jian layout
- 6 column (Corne), re-uses Jian layout

Keymap update includes &studio_unlock.
  • Loading branch information
krikun98 committed Oct 10, 2024
1 parent 2a951fd commit 575c77a
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 3 deletions.
18 changes: 17 additions & 1 deletion app/boards/shields/jiran/jiran.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,26 @@

#include <dt-bindings/zmk/matrix_transform.h>

#include "layouts/full.dtsi"
#include "layouts/jian.dtsi"
#include "layouts/6column.dtsi"

&ladniy_jiran_full_layout {
transform = <&default_transform>;
};

&kgoh_jian_full_layout {
transform = <&jian_transform>;
};

&kgoh_jian_6col_layout {
transform = <&crkbd_transform>;
};

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix-transform = &default_transform;
zmk,physical-layout = &ladniy_jiran_full_layout;
};

default_transform: keymap_transform_0 {
Expand Down
4 changes: 2 additions & 2 deletions app/boards/shields/jiran/jiran.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
lower_layer {
bindings = <
&kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp EQUAL
&kp F11 &kp TAB &bt BT_CLR &kp HOME &sys_reset &kp PG_UP &kp C_VOL_UP &kp C_VOL_UP &kp PG_UP &sys_reset &kp HOME &kp INS &kp DEL &kp F12
&kp F11 &kp TAB &bt BT_CLR &kp HOME &sys_reset &kp PG_UP &kp C_VOL_UP &kp C_VOL_UP &kp PG_UP &studio_unlock &kp HOME &kp INS &kp DEL &kp F12
&kp LSHIFT &bt BT_NXT &kp LEFT &kp UP &kp RIGHT &kp C_MUTE &kp C_MUTE &kp LEFT &kp UP &kp RIGHT &kp PSCRN &mt RSHIFT SLCK
&kp LCTRL &bt BT_PRV &kp END &kp DOWN &kp PG_DN &kp C_VOL_DN &kp C_VOL_DN &kp PG_DN &kp DOWN &kp END &kp PAUSE_BREAK &mt RCTRL KP_NUM
&trans &kp SPACE &kp LALT &mt RALT RET &kp BSPC &trans
>;
};
};
};
};
20 changes: 20 additions & 0 deletions app/boards/shields/jiran/layouts/6column.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <layouts/kgoh/jian/6column.dtsi>
#include <physical_layouts.dtsi>

#include "position_map.dtsi"

&layouts_kgoh_jian_position_map {
status = "disabled";
};

&layouts_ladniy_jiran_position_map {
ladniy_jiran_6col_posmap: six {
physical-layout = <&kgoh_jian_6col_layout>;
positions
= < 42 43 44 45 46 47 48 49 50 51 52 53 >
, <54 0 1 2 3 4 5 6 7 8 9 10 11 55>
, < 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 >;
};
};
81 changes: 81 additions & 0 deletions app/boards/shields/jiran/layouts/full.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#include <physical_layouts.dtsi>

#include "position_map.dtsi"

/ {
ladniy_jiran_full_layout: ladniy_jiran_full_layout {
compatible = "zmk,physical-layout";
display-name = "Full (with pinky/numbers)";

keys // w h x y rot rx ry
= <&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 0 250 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 1600 250 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 100 375 0 0 0>
, <&key_physical_attrs 100 100 200 362 0 0 0>
, <&key_physical_attrs 100 100 300 325 0 0 0>
, <&key_physical_attrs 100 100 400 300 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 1000 337 0 0 0>
, <&key_physical_attrs 100 100 1100 325 0 0 0>
, <&key_physical_attrs 100 100 1200 300 0 0 0>
, <&key_physical_attrs 100 100 1300 325 0 0 0>
, <&key_physical_attrs 100 100 1400 362 0 0 0>
, <&key_physical_attrs 100 100 1500 375 0 0 0>
, <&key_physical_attrs 100 100 500 425 0 0 0>
, <&key_physical_attrs 100 100 600 437 0 0 0>
, <&key_physical_attrs 100 100 700 450 0 0 0>
, <&key_physical_attrs 100 100 900 450 0 0 0>
, <&key_physical_attrs 100 100 1000 437 0 0 0>
, <&key_physical_attrs 100 100 1100 425 0 0 0>
;
};
};

&layouts_ladniy_jiran_position_map {
ladniy_jiran_full_posmap: full {
physical-layout = <&ladniy_jiran_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 44 45 46 47 48 49 >
, < 50 51 52 53 54 55 >;
};
};
24 changes: 24 additions & 0 deletions app/boards/shields/jiran/layouts/jian.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <layouts/kgoh/jian/full.dtsi>
#include <physical_layouts.dtsi>

#include "position_map.dtsi"

&kgoh_jian_full_layout {
display-name = "Jian (with pinky)";
};

&layouts_kgoh_jian_position_map {
status = "disabled";
};

&layouts_ladniy_jiran_position_map {
ladniy_jiran_jian_posmap: jian {
physical-layout = <&kgoh_jian_full_layout>;
positions
= < 44 45 46 47 48 49 50 51 52 53 54 55 >
, < 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 >;
};
};
7 changes: 7 additions & 0 deletions app/boards/shields/jiran/layouts/position_map.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/ {
layouts_ladniy_jiran_position_map: layouts_ladniy_jiran_position_map {
compatible = "zmk,physical-layout-position-map";

complete;
};
};

0 comments on commit 575c77a

Please sign in to comment.