Layouts are defined using Rusty Object Notation (.ron). A layout file consists of a locale (e.g., "US"), a key_shapes map, and key_rows.
key_shapes
A hashmap of String to ShapeType. Common shapes include:
Led(width, height, pad_left, pad_right, pad_top, pad_bottom): Defines an LED spot with dimensions and padding.Blank(width, height): A non-LED space that occupies room in the layout.
key_rows
A list of rows, where each row contains a pad_left, pad_top, and a list of (Key, shape_name) tuples. Key is an enum mapping to specific USB packets/RGB indices. Special key types include:
Spacing: Acts like a non-visible LED.Blocking: Intended to block effects like a row-laser.
Layout Types
- Per-key layouts: Use
PerKey advanced type and can include any LedCode. - Zoned layouts: Use
Zoned advanced type. They can include regular keys and specific zone codes (e.g., ZonedKbLeft, LightbarRightCorner), but cannot use per-key specific codes like LidLogo, LidLeft, or LidRight.
(
locale: "US",
key_shapes: {
"regular": Led(
width: 1.0,
height: 1.0,
pad_left: 0.1,
pad_right: 0.1,
pad_top: 0.1,
pad_bottom: 0.1,
),
"func_space": Blank(
width: 0.2,
height: 0.0,
),
},
key_rows: [
(
pad_left: 0.1,
pad_top: 0.1,
row: [
(Spacing, "rog_spacer"),
(VolDown, "rog_row"),
(VolUp, "rog_row"),
(MicMute, "rog_row"),
(Rog, "rog_row"),
],
),
]
)