Skip to content

Layout Editor

The canvas editor is the main working area of kle-ng. It provides a full set of tools for creating and editing keyboard layouts.

Layout editor canvas with a keyboard layoutLayout editor canvas with a keyboard layout

Canvas Tools

The toolbar on the left side of the canvas contains the main editing tools:

IconToolDescription
Selection ToolSelect, move, resize keys
Move Exactly ToolMove keys by a precise amount
Rotate Selection ToolRotate selected keys around anchor points
Mirror ToolCreate mirrored copies of selected keys
Extra ToolsLegend Tools, Matrix Coordinates, Move Rotation Origins, Theme Tools

Mouse Controls

ActionResult
Left ClickSelect a key
Left Click + DragCreate a rectangle selection
Ctrl + Left ClickAdd/remove key from selection
Middle Click + DragMove selected keys

Keyboard Shortcuts

ShortcutAction
Ctrl+CCopy selected keys
Ctrl+VPaste keys from clipboard
Ctrl+XCut selected keys
Ctrl+ASelect all keys
Del / BackspaceDelete selected keys
Ctrl+ZUndo last action
Ctrl+]Select next key
Ctrl+[Select previous key
Arrow keysNudge selected keys
Shift+Adjust key width
Shift+Adjust key height
AAdd new key
/Toggle label search bar
Shift+MOpen Move Exactly Tool
Shift+ROpen Rotate Selection Tool

Selection Tool

The Selection Tool is the default tool for working with keys.

Selecting Keys

  • Click a key to select it
  • Click and drag on empty canvas area to draw a rectangle selection
  • Hold Ctrl while clicking to add or remove keys from the current selection
  • Use Ctrl+[ and Ctrl+] to cycle through keys in layout order
Key selection animation

Moving Keys

  • Middle mouse button: Click and drag to move the selection
  • Arrow keys: Nudge selected keys by the configured step size

Movement snaps to a configurable step size (defined in U, where 1U = width of a standard key). The step size can be set in the canvas footer.

Canvas footer controls
Mouse movement animation

Lock Rotations

The Lock rotations option determines how rotated keys move:

Lock DisabledLock Enabled
Lock disabledLock enabled
Rotation origin stays fixed; keys move in rotated coordinate spaceRotation origin moves with the keys; movement occurs in normal coordinate space

Move Exactly Tool

For precise movement use the Move Exactly tool (Shift+M).

The tool allows movement to any position, not limited to the step size. It also supports movement in millimeters by specifying the spacing (mm per U). The default spacing is 19.05 mm/U for both X and Y axes, which is standard for Cherry MX style switches.

Using the Tool

Move exactly tool animationMove exactly mm panelMove exactly mm panel

Rotate Selection Tool

Rotate selected keys around anchor points (key corners and centers) using the Rotate Selection tool (Shift+R).

Using the Tool

Rotate tool animation

Mirror Tool

Create mirrored copies of selected keys with the Mirror Tool. Choose a mirror axis position — the axis snaps to multiples of the step size. Supports both vertical (default) and horizontal mirroring from the tool dropdown.

Using the Tool

Mirror tool animation

Extra Tools

Extra tools are grouped under a single button in the left toolbar. There are four:

  1. Legend Tools — bulk legend editing
  2. Add Switch Matrix Coordinates — assign VIA-style row/column labels
  3. Move Rotation Origins — recalculate key positions with a new rotation reference point
  4. Theme Tools — apply color themes to the layout

Legend Tools

Legend tools provide quick canvas-oriented label editing in four modes:

ModeDescription
EditDirect label assignment with auto-advancement to next key after Enter
RemoveRemove all labels at the selected label position
AlignChange label alignment
MoveMove labels from one position to another
Edit ModeMove Mode
Legend tools editLegend tools move

TIP

Legend Tools are designed for easier bulk label editing compared to modifying labels one at a time in the Key Properties panel.

Add Switch Matrix Coordinates

This tool assigns VIA-style row,column labels (e.g., 0,0) to each key, enabling compatibility with VIA and Vial configurators and the PCB Generator.

Switch Matrix Coordinates WindowSwitch Matrix Coordinates Window

The tool provides an Annotate Automatically option that assigns coordinates intelligently based on key positions. You can also draw rows and columns manually:

WARNING

Automatic annotations may not produce correct results for certain keyboard layouts. Ergonomic layouts with significant column splay (angled columns) are particularly affected and may require manual correction of row/column assignments. Standard rectangular layouts typically produce good results. See issue #51 for details.

Draw RowsDraw ColumnsRemove
Draw rowsDraw columnsRemove
  • Left-click to start and complete wire segments
  • Right-click or Escape to cancel
  • Click an existing wire to append to it
  • Hold Ctrl while clicking a wire to remove the entire row/column

To renumber a row or column: hover over it in any editing mode and type the new number.

TIP

To export a PNG with the matrix wire overlay visible, open the Add Switch Matrix Coordinates tool first, then use Export → Download PNG.

Move Rotation Origins

The Move Rotation Origins tool reassigns the rotation origin point for keys without changing their visual position on the canvas. This is useful when you want to reference a different pivot point for subsequent rotations — for example, after repositioning a key cluster, you may want the rotation origin to be the new key center rather than the original one.

The tool operates on selected keys, or on all keys if nothing is selected. Two modes are available:

  • Use key centers — Calculates and sets the rotation origin to the geometric center of each key individually.
  • Manual position — Sets the rotation origin to a fixed X/Y coordinate (in U) for all affected keys.

Theme Tools

The Theme Tools panel applies color themes to the entire layout in bulk. Open it from Extra Tools → Theme Tools.

Theme tools modalTheme tools modal

Choose from several built-in themes in the dropdown:

ThemeDescription
ClassicLight gray keys on a gray background — the classic KLE look
DarkDark gray keys on a near-black background
VIALight gray alphas with darker modifiers, similar to VIA's default display
Gruvbox (dark)Gruvbox color palette with dark background

Themes are defined as JSON objects with named rules and matcher expressions that target specific keys. You can edit the current theme directly in the JSON editor within the panel, or load and save theme files using Load JSON and Save JSON.

The panel also includes a Color Calculator for converting between stored KLE keycap colors and the rendered key-top colors.

See Color Themes for the full theme format, matcher syntax reference, and examples.

Press / to open the label search bar. Type to find keys by their label text. Matches are highlighted on the canvas. Use Enter or the up/down arrows to cycle through matches. Press Escape or / again to close.

TIP

To export a PNG with search match highlighting visible, keep the search bar open before using Export → Download PNG.

Canvas Settings

A settings panel is accessible from the toolbar (gear icon). Current settings:

SettingDescription
Show gridToggles a dot grid on the canvas aligned to the current step size
Highlight ColorColor used to indicate selected keys. Click the swatch to change it

Released under the MIT License.