Skip to content

Commit

Permalink
common layouts approach
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Munnich committed Oct 23, 2024
1 parent 4de9441 commit 317f83b
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 143 deletions.
139 changes: 0 additions & 139 deletions app/boards/shields/kyria/kyria-layouts.dtsi

This file was deleted.

2 changes: 2 additions & 0 deletions app/boards/shields/kyria/kyria.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/

#include "kyria_common.dtsi"
#include "layouts/kyria_6col-layout.dtsi"
#include "layouts/kyria_5col-layout.dtsi"

/ {
default_transform: keymap_transform_0 {
Expand Down
2 changes: 0 additions & 2 deletions app/boards/shields/kyria/kyria_common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

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

#include "kyria-layouts.dtsi"

/ {
chosen {
zephyr,display = &oled;
Expand Down
2 changes: 2 additions & 0 deletions app/boards/shields/kyria/kyria_rev2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/

#include "kyria_common.dtsi"
#include "layouts/kyria_6col-layout.dtsi"
#include "layouts/kyria_5col-layout.dtsi"

/ {
default_transform: keymap_transform_0 {
Expand Down
3 changes: 1 addition & 2 deletions app/boards/shields/kyria/kyria_rev3.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
*/

#include "kyria_common.dtsi"

/delete-node/ &splitkb_kyria_5col_layout;
#include "layouts/kyria_6col-layout.dtsi"

/ {
default_transform: keymap_transform_0 {
Expand Down
57 changes: 57 additions & 0 deletions app/boards/shields/kyria/layouts/kyria_5col-layout.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include <physical_layouts.dtsi>
#include "position_map.dtsi"

/{
splitkb_kyria_5col_layout: splitkb_kyria_5col_layout {
compatible = "zmk,physical-layout";
display-name = "5 Column";
transform = <&five_column_transform>;

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 75 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 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 75 0 0 0>
, <&key_physical_attrs 100 100 0 175 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 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 175 0 0 0>
, <&key_physical_attrs 100 100 0 275 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 250 225 3000 300 792>
, <&key_physical_attrs 100 100 250 225 4500 300 792>
, <&key_physical_attrs 100 100 1150 225 (-4500) 1200 792>
, <&key_physical_attrs 100 100 1150 225 (-3000) 1200 792>
, <&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 275 0 0 0>
, <&key_physical_attrs 100 100 150 325 0 0 0>
, <&key_physical_attrs 100 100 250 325 0 0 0>
, <&key_physical_attrs 100 100 250 325 1500 300 792>
, <&key_physical_attrs 100 100 250 325 3000 300 792>
, <&key_physical_attrs 100 100 250 325 4500 300 792>
, <&key_physical_attrs 100 100 1150 325 (-4500) 1200 792>
, <&key_physical_attrs 100 100 1150 325 (-3000) 1200 792>
, <&key_physical_attrs 100 100 1150 325 (-1500) 1200 792>
, <&key_physical_attrs 100 100 1150 325 0 0 0>
, <&key_physical_attrs 100 100 1250 325 0 0 0>
;
};
};
63 changes: 63 additions & 0 deletions app/boards/shields/kyria/layouts/kyria_6col-layout.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include <physical_layouts.dtsi>
#include "position_map.dtsi"

/{
splitkb_kyria_6col_layout: splitkb_kyria_6col_layout {
compatible = "zmk,physical-layout";
display-name = "6 Column";
transform = <&default_transform>;

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 75 0 0 0>
, <&key_physical_attrs 100 100 100 75 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 1100 37 0 0 0>
, <&key_physical_attrs 100 100 1200 25 0 0 0>
, <&key_physical_attrs 100 100 1300 0 0 0 0>
, <&key_physical_attrs 100 100 1400 25 0 0 0>
, <&key_physical_attrs 100 100 1500 75 0 0 0>
, <&key_physical_attrs 100 100 1600 75 0 0 0>
, <&key_physical_attrs 100 100 0 175 0 0 0>
, <&key_physical_attrs 100 100 100 175 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 1100 137 0 0 0>
, <&key_physical_attrs 100 100 1200 125 0 0 0>
, <&key_physical_attrs 100 100 1300 100 0 0 0>
, <&key_physical_attrs 100 100 1400 125 0 0 0>
, <&key_physical_attrs 100 100 1500 175 0 0 0>
, <&key_physical_attrs 100 100 1600 175 0 0 0>
, <&key_physical_attrs 100 100 0 275 0 0 0>
, <&key_physical_attrs 100 100 100 275 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 350 225 3000 400 792>
, <&key_physical_attrs 100 100 350 225 4500 400 792>
, <&key_physical_attrs 100 100 1250 225 (-4500) 1300 792>
, <&key_physical_attrs 100 100 1250 225 (-3000) 1300 792>
, <&key_physical_attrs 100 100 1100 237 0 0 0>
, <&key_physical_attrs 100 100 1200 225 0 0 0>
, <&key_physical_attrs 100 100 1300 200 0 0 0>
, <&key_physical_attrs 100 100 1400 225 0 0 0>
, <&key_physical_attrs 100 100 1500 275 0 0 0>
, <&key_physical_attrs 100 100 1600 275 0 0 0>
, <&key_physical_attrs 100 100 250 325 0 0 0>
, <&key_physical_attrs 100 100 350 325 0 0 0>
, <&key_physical_attrs 100 100 350 325 1500 400 792>
, <&key_physical_attrs 100 100 350 325 3000 400 792>
, <&key_physical_attrs 100 100 350 325 4500 400 792>
, <&key_physical_attrs 100 100 1250 325 (-4500) 1300 792>
, <&key_physical_attrs 100 100 1250 325 (-3000) 1300 792>
, <&key_physical_attrs 100 100 1250 325 (-1500) 1300 792>
, <&key_physical_attrs 100 100 1250 325 0 0 0>
, <&key_physical_attrs 100 100 1350 325 0 0 0>
;
};
};
25 changes: 25 additions & 0 deletions app/boards/shields/kyria/layouts/position_map.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/{
splitkb_kyria_position_map: splitkb_kyria_position_map {
compatible = "zmk,physical-layout-position-map";

complete;

twelve {
physical-layout = <&splitkb_kyria_6col_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 >;
};

ten {
physical-layout = <&splitkb_kyria_5col_layout>;
positions
= <44 0 1 2 3 4 5 6 7 8 9 47>
, <45 10 11 12 13 14 15 16 17 18 19 48>
, <46 20 21 22 23 24 25 26 27 28 29 30 31 32 33 49>
, < 34 35 36 37 38 39 40 41 42 43 >;
};
};
};

0 comments on commit 317f83b

Please sign in to comment.