Skip to content

Commit

Permalink
feat(boards): Add numpad layouts
Browse files Browse the repository at this point in the history
Added physical layouts for the following variants of numpads:

- With and without extra top row
- 2U plus key or 1U plus and backspace keys
- 2U 0 key or 1U 0 and 00 keys
- Full 1U grid/macropad layout

Other layouts exist, such as "southpaw" horizontally mirrored layouts,
and layouts with a fifth column, but those seem to be much less common.
  • Loading branch information
joelspadin authored and petejohanson committed Nov 6, 2024
1 parent e6c1219 commit cf2c467
Show file tree
Hide file tree
Showing 11 changed files with 471 additions and 0 deletions.
43 changes: 43 additions & 0 deletions app/dts/layouts/common/numpad/17_key.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <layouts/common/numpad/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
layout_numpad_17_key: layout_numpad_17_key {
compatible = "zmk,physical-layout";
display-name = "17 Key Numpad";

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 100 100 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 200 300 100 0 0 0>
, <&key_physical_attrs 100 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 100 200 0 0 0>
, <&key_physical_attrs 100 100 200 200 0 0 0>
, <&key_physical_attrs 100 100 0 300 0 0 0>
, <&key_physical_attrs 100 100 100 300 0 0 0>
, <&key_physical_attrs 100 100 200 300 0 0 0>
, <&key_physical_attrs 100 200 300 300 0 0 0>
, <&key_physical_attrs 200 100 0 400 0 0 0>
, <&key_physical_attrs 100 100 200 400 0 0 0>
;
};
};

&layouts_common_numpad_position_map {
layout_numpad_17_key {
physical-layout = <&layout_numpad_17_key>;
positions
= <17 18 19 20>
, < 0 1 2 3>
, < 4 5 6 7>
, < 8 9 10 21>
, <11 12 13 14>
, <15 22 16 23>
;
};
};
44 changes: 44 additions & 0 deletions app/dts/layouts/common/numpad/18_key.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include <layouts/common/numpad/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
layout_numpad_18_key: layout_numpad_18_key {
compatible = "zmk,physical-layout";
display-name = "18 Key Numpad";

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 100 100 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 100 300 100 0 0 0>
, <&key_physical_attrs 100 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 100 200 0 0 0>
, <&key_physical_attrs 100 100 200 200 0 0 0>
, <&key_physical_attrs 100 100 300 200 0 0 0>
, <&key_physical_attrs 100 100 0 300 0 0 0>
, <&key_physical_attrs 100 100 100 300 0 0 0>
, <&key_physical_attrs 100 100 200 300 0 0 0>
, <&key_physical_attrs 100 200 300 300 0 0 0>
, <&key_physical_attrs 200 100 0 400 0 0 0>
, <&key_physical_attrs 100 100 200 400 0 0 0>
;
};
};

&layouts_common_numpad_position_map {
layout_numpad_18_key {
physical-layout = <&layout_numpad_18_key>;
positions
= <18 19 20 21>
, < 0 1 2 3>
, < 4 5 6 7>
, < 8 9 10 11>
, <12 13 14 15>
, <16 22 17 23>
;
};
};
44 changes: 44 additions & 0 deletions app/dts/layouts/common/numpad/18_key_00.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include <layouts/common/numpad/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
layout_numpad_18_key_00: layout_numpad_18_key_00 {
compatible = "zmk,physical-layout";
display-name = "18 Key Numpad (00)";

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 100 100 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 200 300 100 0 0 0>
, <&key_physical_attrs 100 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 100 200 0 0 0>
, <&key_physical_attrs 100 100 200 200 0 0 0>
, <&key_physical_attrs 100 100 0 300 0 0 0>
, <&key_physical_attrs 100 100 100 300 0 0 0>
, <&key_physical_attrs 100 100 200 300 0 0 0>
, <&key_physical_attrs 100 200 300 300 0 0 0>
, <&key_physical_attrs 100 100 0 400 0 0 0>
, <&key_physical_attrs 100 100 100 400 0 0 0>
, <&key_physical_attrs 100 100 200 400 0 0 0>
;
};
};

&layouts_common_numpad_position_map {
layout_numpad_18_key_00 {
physical-layout = <&layout_numpad_18_key_00>;
positions
= <18 19 20 21>
, < 0 1 2 3>
, < 4 5 6 7>
, < 8 9 10 22>
, <11 12 13 14>
, <15 16 17 23>
;
};
};
45 changes: 45 additions & 0 deletions app/dts/layouts/common/numpad/19_key_00.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include <layouts/common/numpad/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
layout_numpad_19_key_00: layout_numpad_19_key_00 {
compatible = "zmk,physical-layout";
display-name = "19 Key Numpad (00)";

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 100 100 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 100 300 100 0 0 0>
, <&key_physical_attrs 100 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 100 200 0 0 0>
, <&key_physical_attrs 100 100 200 200 0 0 0>
, <&key_physical_attrs 100 100 300 200 0 0 0>
, <&key_physical_attrs 100 100 0 300 0 0 0>
, <&key_physical_attrs 100 100 100 300 0 0 0>
, <&key_physical_attrs 100 100 200 300 0 0 0>
, <&key_physical_attrs 100 200 300 300 0 0 0>
, <&key_physical_attrs 100 100 0 400 0 0 0>
, <&key_physical_attrs 100 100 100 400 0 0 0>
, <&key_physical_attrs 100 100 200 400 0 0 0>
;
};
};

&layouts_common_numpad_position_map {
layout_numpad_19_key_00 {
physical-layout = <&layout_numpad_19_key_00>;
positions
= <19 20 21 22>
, < 0 1 2 3>
, < 4 5 6 7>
, < 8 9 10 11>
, <12 13 14 15>
, <16 17 18 23>
;
};
};
46 changes: 46 additions & 0 deletions app/dts/layouts/common/numpad/20_key.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include <layouts/common/numpad/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
layout_numpad_20_key: layout_numpad_20_key {
compatible = "zmk,physical-layout";
display-name = "20 Key Numpad";

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 0 100 0 0 0>
, <&key_physical_attrs 100 100 100 100 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 100 300 100 0 0 0>
, <&key_physical_attrs 100 100 0 200 0 0 0>
, <&key_physical_attrs 100 100 100 200 0 0 0>
, <&key_physical_attrs 100 100 200 200 0 0 0>
, <&key_physical_attrs 100 100 300 200 0 0 0>
, <&key_physical_attrs 100 100 0 300 0 0 0>
, <&key_physical_attrs 100 100 100 300 0 0 0>
, <&key_physical_attrs 100 100 200 300 0 0 0>
, <&key_physical_attrs 100 100 300 300 0 0 0>
, <&key_physical_attrs 100 100 0 400 0 0 0>
, <&key_physical_attrs 100 100 100 400 0 0 0>
, <&key_physical_attrs 100 100 200 400 0 0 0>
, <&key_physical_attrs 100 100 300 400 0 0 0>
;
};
};

&layouts_common_numpad_position_map {
layout_numpad_20_key {
physical-layout = <&layout_numpad_20_key>;
positions
= <20 21 22 23>
, < 0 1 2 3>
, < 4 5 6 7>
, < 8 9 10 11>
, <12 13 14 15>
, <16 17 18 19>
;
};
};
47 changes: 47 additions & 0 deletions app/dts/layouts/common/numpad/21_key.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include <layouts/common/numpad/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
layout_numpad_21_key: layout_numpad_21_key {
compatible = "zmk,physical-layout";
display-name = "21 Key Numpad";

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 0 125 0 0 0>
, <&key_physical_attrs 100 100 100 125 0 0 0>
, <&key_physical_attrs 100 100 200 125 0 0 0>
, <&key_physical_attrs 100 100 300 125 0 0 0>
, <&key_physical_attrs 100 100 0 225 0 0 0>
, <&key_physical_attrs 100 100 100 225 0 0 0>
, <&key_physical_attrs 100 100 200 225 0 0 0>
, <&key_physical_attrs 100 200 300 225 0 0 0>
, <&key_physical_attrs 100 100 0 325 0 0 0>
, <&key_physical_attrs 100 100 100 325 0 0 0>
, <&key_physical_attrs 100 100 200 325 0 0 0>
, <&key_physical_attrs 100 100 0 425 0 0 0>
, <&key_physical_attrs 100 100 100 425 0 0 0>
, <&key_physical_attrs 100 100 200 425 0 0 0>
, <&key_physical_attrs 100 200 300 425 0 0 0>
, <&key_physical_attrs 200 100 0 525 0 0 0>
, <&key_physical_attrs 100 100 200 525 0 0 0>
;
};
};

&layouts_common_numpad_position_map {
layout_numpad_21_key {
physical-layout = <&layout_numpad_21_key>;
positions
= < 0 1 2 3>
, < 4 5 6 7>
, < 8 9 10 11>
, <12 13 14 21>
, <15 16 17 18>
, <19 22 20 23>
;
};
};
48 changes: 48 additions & 0 deletions app/dts/layouts/common/numpad/22_key.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <layouts/common/numpad/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
layout_numpad_22_key: layout_numpad_22_key {
compatible = "zmk,physical-layout";
display-name = "22 Key Numpad";

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 0 125 0 0 0>
, <&key_physical_attrs 100 100 100 125 0 0 0>
, <&key_physical_attrs 100 100 200 125 0 0 0>
, <&key_physical_attrs 100 100 300 125 0 0 0>
, <&key_physical_attrs 100 100 0 225 0 0 0>
, <&key_physical_attrs 100 100 100 225 0 0 0>
, <&key_physical_attrs 100 100 200 225 0 0 0>
, <&key_physical_attrs 100 100 300 225 0 0 0>
, <&key_physical_attrs 100 100 0 325 0 0 0>
, <&key_physical_attrs 100 100 100 325 0 0 0>
, <&key_physical_attrs 100 100 200 325 0 0 0>
, <&key_physical_attrs 100 100 300 325 0 0 0>
, <&key_physical_attrs 100 100 0 425 0 0 0>
, <&key_physical_attrs 100 100 100 425 0 0 0>
, <&key_physical_attrs 100 100 200 425 0 0 0>
, <&key_physical_attrs 100 200 300 425 0 0 0>
, <&key_physical_attrs 200 100 0 525 0 0 0>
, <&key_physical_attrs 100 100 200 525 0 0 0>
;
};
};

&layouts_common_numpad_position_map {
layout_numpad_22_key {
physical-layout = <&layout_numpad_22_key>;
positions
= < 0 1 2 3>
, < 4 5 6 7>
, < 8 9 10 11>
, <12 13 14 15>
, <16 17 18 19>
, <20 22 21 23>
;
};
};
48 changes: 48 additions & 0 deletions app/dts/layouts/common/numpad/22_key_00.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <layouts/common/numpad/position_map.dtsi>
#include <physical_layouts.dtsi>

/ {
layout_numpad_22_key_00: layout_numpad_22_key_00 {
compatible = "zmk,physical-layout";
display-name = "22 Key Numpad (00)";

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 0 0 0 0>
, <&key_physical_attrs 100 100 100 0 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 0 0 0 0>
, <&key_physical_attrs 100 100 0 125 0 0 0>
, <&key_physical_attrs 100 100 100 125 0 0 0>
, <&key_physical_attrs 100 100 200 125 0 0 0>
, <&key_physical_attrs 100 100 300 125 0 0 0>
, <&key_physical_attrs 100 100 0 225 0 0 0>
, <&key_physical_attrs 100 100 100 225 0 0 0>
, <&key_physical_attrs 100 100 200 225 0 0 0>
, <&key_physical_attrs 100 200 300 225 0 0 0>
, <&key_physical_attrs 100 100 0 325 0 0 0>
, <&key_physical_attrs 100 100 100 325 0 0 0>
, <&key_physical_attrs 100 100 200 325 0 0 0>
, <&key_physical_attrs 100 100 0 425 0 0 0>
, <&key_physical_attrs 100 100 100 425 0 0 0>
, <&key_physical_attrs 100 100 200 425 0 0 0>
, <&key_physical_attrs 100 200 300 425 0 0 0>
, <&key_physical_attrs 100 100 0 525 0 0 0>
, <&key_physical_attrs 100 100 100 525 0 0 0>
, <&key_physical_attrs 100 100 200 525 0 0 0>
;
};
};

&layouts_common_numpad_position_map {
layout_numpad_22_key_00 {
physical-layout = <&layout_numpad_22_key_00>;
positions
= < 0 1 2 3>
, < 4 5 6 7>
, < 8 9 10 11>
, <12 13 14 22>
, <15 16 17 18>
, <19 20 21 23>
;
};
};
Loading

0 comments on commit cf2c467

Please sign in to comment.