This article presents a keyboard layout suitable for 40% keyboards, based on “home row mods”. The layout is designed for software developers and authors of multilingual texts. Particular emphasis was placed on ease of learning. The layout presented here is implemented both as a Kanata driver for standard keyboards on Linux, Mac, and Windows computers, and as ZMK Firmware for small 36-38 key column-staggered split keyboards. This way you benefit from ergonomic home row mods on all your input devices.

base layer

Requirements

Before I go into the details of the implementation, I would like to present the list of requirements that formed the basis for the layout presented here:

  1. The reduced 36-key layout is easy to learn by design:

    • A character in the standard layout should, if possible, be accessible with the same finger in the reduced layout.

    • The Shift key retains its function, i.e., it always switches between the same characters in both layouts. The same applies analogously to other modifier keys, i.e. [left Ctrl], [Win], [Alt], [AltGr], [left GUI], [right GUI] and [right Ctrl].1

    • All movements for the cursor, mouse, etc. follow the VI convention in the right home row: to the left [H], down [J], up [K], to the right [;] and are operated with the index finger (2*), the middle finger, and the ring finger.

  2. Additional requirements for multilingual text writing:

    • The US International and EurKEY keyboard layouts make extensive use of modifier keys [AltGr] and [AltGr]+[Shift]. These must be easy and ergonomic to reach.

    • One key in the thumb cluster should be designated as the [Compose] key.2

Home Row Mods with ZMK firmware

The design presented here is intended for small keyboards, but also has ergonomic advantages on large keyboards. In the repository getreu/zmk-config-totem, readers will find an implementation as ZMK firmware for the 38-key TOTEM keyboard. If you do not wish to purchase hardware, the same repository contains the Kanata keyboard layout definition file zmk-config-totem/kanata/qwerty-home-row-mods.kbd that includes all the functions and layers of the design presented below. Kanata hooks into the data stream between the keyboard and the keyboard driver. This allows to define home row mods with additional layers and chords.

The base layer

The base layer shows the position of all character keys (from [A] to [Z], [,], [.] and [/]) and the editing keys (tab [TAB], return [RET], escape [ESC], space [SPACE], backspace [BACKSPACE], compose [CMENU]2).

Base layer

It has to noted, that the here presented implementation does not specify the visual layout, that may vary by country and language. For example, the character printed by the [;] key is in Germany the letter “ö”. For simplicity's sake, the QWERTY layout is shown here. The actual layout, e.g. QWERTZ or AZERTY is determined by the operating system's setting of the computer the keyboard is attached to. However, this design does define the arrangement of the modifier and the layer switch keys, as can be seen in the next figure:

Modifier keys

Modifier and layer switch keys act in combination with another key: a modifier key must be held down while tapping the other key. For example, the [E] key pressed alone prints “e”, while [RSHIFT]+[E] prints “E”.

An overview of common home row mods choices can be found in this blog post. The solution presented here takes another approach. It extends the conventional home row to include the keys [G], [V], [space] on the left and [H], [M], [space] on the right.

On the left-hand side you will find the modifier keys: left shift [LSHIFT], right alt [RIGHT ALT], left control [LCTRL], left alt [LEFT ALT], menu [RGUI] and Windows [LGUI] key, as well as the layer switch key (underlined) symbol [SYMB]. On the right-hand side you will find the same keys, but in reversed order. Note, that the keys [LEFT ALT], [RIGHT ALT], [LGUI] and [RGUI] appear on both sides of the keyboard, whereas [LSHIFT], [RSHIFT], [LCTRL] an [RCTRL] appear only once! Indeed, the modifiers [LEFT ALT] and [RIGHT ALT] have different meanings and each of them can be combined with any character key on both sides of the keyboard. This is the reason why [LEFT ALT] and [RIGHT ALT] are present on the left half of the keyboard as well as on the right half. The same applies to the [LGUI] and [RGUI] keys. Home row keys can trigger auto-repeat when first tapped and then quickly hold.

Why have I chosen this particular home row mods order?

  • The shift modifier [LSHIFT] assigned to the [A] key which is operated by the ring finger. Since all traditional layouts use the ring finger for shift, learning the new position is easy.

  • To the right of it, on the [S] key, is the [AltGr] modifier. [AltGr] is often used together with [Shift] in the “US-intl” and “EurKEY“ layouts, so the proximity of both modifiers makes it much easier to type letters with accents.

  • One position further, on the [D] key, is the symbol layer switch [SYMB]. Again, it is frequently used in combination with the two previous keys, so its position makes it easier to type quickly. This modifier, which is used very often in software programming, is operated by the middle finger, one of the strongest fingers in the hand.

  • The commonly used [Ctrl] modifier is located in a prominent position on the [F] key. It is operated by the index finger.

  • The last modifier in the home row is [Alt], which is located on the [G] key. The position is not quite as easy to reach as the previous one, as the index finger has to be stretched, but its function is similar to that of the Control key, so grouping them together feels natural.

  • Strictly speaking, the remaining modifiers [LGUI] and [RGUI] are no longer on the home row, but they are still easy to reach. You can think of them as an extended home row. They are located on the [V] and [space] keys. In addition to their function as modifiers, pressing both keys together activates the system layer [SYST].

The home row on the right side of the keyboard is arranged in mirror symmetry.

The Symbol layer

The [SYMB] key, when hold down, switches to the “symbol layer” as shown below. It can be combined with any other modifier key. For example, the key combination [SYMB]+[n] prints “\”, while the key combination [SYMB]+[LSHIFT]+[n] prints “|”. Other accessible characters are the numbers 1 to 0, and when combined with [SYMB]+[SHIFT] the special characters “!@#$%^&*()”. The third row contains the characters “-=[]\,./” and “~_{}|¨<>?” when shifted. On the home (second) row we find the editing keys [ESCAPE], [TAB], [DELETE], [BACKSPACE], [INS] and [ENTER] as well as the cursor keys [LEFT], [DOWN], [UP] and [RIGHT]. The latter follows the VI convention.

Symbol layer

The Function layer

Function layer

When this layer is active, the position of the function keys [F1]-[F10] is the same as the number keys [1]-[0] of the previous layer. The remaining function keys are distributed row by row.

The Navigation layer

The middle thumb key in the right thumb cluster, when hold down, activates the navigation layer. This layer offers the additional cursor keys: [HOME], [DEL], [INS], [END], [BACKSPACE], [PAGE DOWN] and [PAGE UP].

Note, that the second row assignment is the same as in the symbol layer. However, there is a subtle difference, as the keys have no additional “hold” function. This allows to trigger auto-repeat by simply holding down the key.

Navigation layer

The Mouse layer

Mouse layer

The mouse layer is triggered with the middle key of the left thumb cluster. The left-hand side groups motion keys for the mouse cursor and the mouse wheel, each following the VI conventions line per line. The mouse buttons are placed on the right-hand side of the keyboard.

The System layer

The system layer is reached with the combos [v]+[space] or [m]+[space] which corresponds to [LGUI]+[RGUI].

Combo

The left-hand side groups keys to select one of 5 Bluetooth connection profiles and other connection parameters. Volume and screen brightness settings are on the right-hand side. The up/down settings follow the VI convention.

System layer

Combos (chords)

Combo: [CapsLock]

Combo: [Bootloader]

Home row mods on standard keyboards with Kanata

The above home row mods do not rely on special hardware. The Kanata software allows home row mods to be set up even on standard keyboards such as those found on laptops. The figure below shows the base layer of such a setup. The other layers: Symbol, Function, Navigation, Mouse and System are defined analogously.

Home row mods on standard keyboards: Base layer

Image source: Wikimedia Commons

Differences between the ZMK implementation and the Kanata implementation:

  • The Kanata layout is by default disabled. To enable home row mods press the chord [Esc]+[1]. To disable press [Esc]+[2].
  • The Kanata layout does not implement the [BootLoader] chord, see above.
  • The SYSTEM layer of the Kanata definition, does not define Bluetooth keys.

The Kanata keyboard definition file is available here: zmk-config-totem/kanata/qwerty-home-row-mods.kbd

1

This requirement makes the design localization agnostic, e.g.: the same home row mods design works for US, UK, German and French keyboards.

2

There is no official key code for the [Compose] key that could be sent to the host computer by the keyboard. Therefore, we have to misuse the key code of a little-used key for the “Compose” function. A popular choice is the “application” key, also known as the “menu” key. In the layouts shown here, the abbreviation [CMENU] is used. So when the user presses the [Compose] key, the keyboard sends the key code of the [CMENU] key to the host computer. On the operating system side, the [CMENU] key code emitted by the keyboard, must be interpreted as “Compose” action. The Compose key action can be assigned to the [CMENU] key code using the Linux X11 option: compose:menu. For example: services.xserver.xkb.options = "compose:menu"; in NixOS. Windows does not support the Compose key action and therefore requires an additional utility program.