Building A Perfect Keyboard

Boris Churzin
9 min readJun 3, 2023

It happened! I’m finally at peace with my keyboard*: it fits me ergonomically**; its firmware provides flexible, thought-through tooling that could handle any (mostly self-inflicted) needs I have***; any physical harm I occasionally do to it can be quickly repaired by me, at home****!@#$

But first, why?

Reasons

My new (back then) job forced me to use a Mac laptop (which is a fine piece of equipment) and a Mac keyboard (also a fine piece of equipment not intended for human hands), and as a result, my carpal tunnel syndrome forced me to search for better ergonomic solutions than drugs.

Little did I know.

First attempt, Microsoft Ergonomic Keyboard:

The equals sign is above the quote key, while on the regular keyboards, it’s staggered half key to the right

Immediate relief of pain, wireless, huge, 7890-= buttons are shifted to the left. A month later I was still hitting backspace instead of the equals sign.

The second attempt, let’s try the best I can find on the market! Ergodox EZ Moonlander:

So pretty!

Wired, split (wired), hot-swappable switches, ortholinear(!), customizable (QMK), great for couch gaming (right part is detachable), well-built, big, pricey, thumb buttons felt not in the right place. I used this one for a long time, by now I would consider it a very expensive way to get into the customizable keyboards world (and try out different switches).

Second and a half attempt which became a third, Ergodox EZ Planck:

As Moonlander was such a success for me, but wasn’t useful for working on the couch (halves are wired and big), I decided to get a Planck — two columns less than Moonlander, wired, non-split, ortholinear, customizable, still great for couch gaming (small enough), well-built, small, not-so-pricey, some buttons on the bottom row are useless (can’t easily reach with either pinkies or thumbs). It quickly became my number one keyboard, I had to pluck out the “extra” buttons and get used to yet another layout.

This experience, although unreasonably expensive, taught me what I really want, hence:

The Requirements

  • Small — this was a major insight! At first, I thought my hands hurt because the staggered layout is dumb or because I have to stress my shoulders on a non-split keyboard. But nope — pinkies. It’s all about pinkies in my case, see the [Customizable] section for more.
  • Wireless — it’s not the stone age anymore.
  • Power efficient — recharging sucks.
  • Wirelessly Split — have you tried a split keyboard on a good Lazy-Boy couch chair? There is quite nothing like that Godfather feeling; now imagine it with a wire across your lap, not quite the same isn’t it?
Al Pacino is waiting for a build to finish
  • Connecting to multiple devices at the same time.
  • Hot-swappable switches — although each doesn’t break frequently, there are a lot of them (34 in my case), occasionally I have to switch one (~3/year so far), plucking it out and sticking another one in beats resoldering which beats buying a new keyboard.
  • Well-built, easily rebuilt, or cheap enough to have a spare — don’t wanna get stuck without the “good” keyboard.

Searching For Solutions

Long story short — thank you Ben Vallack, check out his channel for visual, high-level guidance.

Designing The Keyboard

There was an error in my method (let’s pretend there was a method) — when I switched to the Moonlander, I changed three parameters!:
- Non-Split -> Split
- Staggered -> Ortholinear
- Regular-> Customizable

All three changes were beneficial, but only one of them actually cured my pain. Let’s break down each one of these as each might be important in your case:

Split

When your hands are decoupled from each other you get another level of freedom (similar to Nintendo’s JoyCons), once you can put your hands wherever you feel comfortable — the wrists and the rest of your body will thank you.

Ortholinear

Not a real DAS keyboard, keep drooling

It’s hard to explain the difference, but I’ll try — it’s when 2 is above w which is above s which is above x, like sane humans would design it. Directly above each other — unlike the staggered keyboards, the positioning of the keys is not a function of the keyboard manufacturer’s mood.

There are other reasons, and a couple of research attempts trying to calculate which layout has the minimal travel path and whatnot. But for me — it just makes more sense! I don’t want to retrain myself for each keyboard — 8 is above i, / is below '! Even when it felt “different” at first until muscle memory settled in, and I was missing many buttons — it felt right!

Customizable

If you think ZMK DSL is cryptic — wait till you see the errors!

This is how I realized my pinkies were hurting me:

As you might have guessed — I’m an avid Vim user and I use ctrl and esc a lot (by the same reasoning, you might have guessed “emacs”, and you would’ve been right — emacs users’ pinkies work even harder; one of the reasons I don’t use emacs).

The first thing I did when I got the Moonlander — I converted all the frequently used keys — into thumbs keys. This makes sense — think of how a regular, PC keyboard is built (Mac keyboards have an only advantage — Cmdis a thumb key, the rest of the keyboard actively hates you), the most frequently-used keys on a PC keyboard, and the fingers you use to hit them:

  • Space — thumb
  • Shift — pinky
  • Backspace — pinky
  • Enter — pinky
  • Ctrl — pinky
  • Escape — extra long pinky
  • Arrows — goodbye home row: a workout for your right hand, your eyes, and your sanity
How is this work distribution among fingers reasonable?

I admire the person who thought “Hey, this space button is for sure useful! Let’s place it somewhere nice!”, and I despise the rest of the people in charge of the first keyboard design. My speculation about why thumbs are underused is that all the useful thumb space was taken by the unreasonably long spacebar; in contrast, the space key on my keyboard is bound to an actual, legit, square key, and it shares it with a modifier!

Once I relieved my pinkies of their un-proportionally big to their ability duty — the pain was gone. And, surprisingly, despite the reduction in the number of buttons at my disposal — I typed faster!

Actually Building The Thing

See Actually Building The Perfect Keyboard for the physical layout, prerequisites, shopping list, and all the soldering gory details.

Surprisingly the material part of the keyboard has some leeway in terms of build quality for it to function well. With some incarnations (I had multiple builds by now) I had to nudge the chip a little from time to time forokey t wrk. Some had a rrreapeating r problem. But mostly — they just wrrked.

The Virtual Layout

Now this is the fun part! This is what makes these keyboards so powerful. There is plenty of information about How ZMK Works, and how to create your own zmk-config and flush it.

I think explaining my layout, the layers I use, and the decisions behind is more interesting.

Modifiers

(this section is a bit more technical and jokeless, just skip it)

But first, a word about “modifiers” and “layers”, the magic behind the ZMK/QMK firmwares: a modifier is a key that has a special behavior, e.g. changing a layer.

Shift key is an example of a modifier — while pressed, it changes your keyboard’s layout (layer) to another one — most of the change is easy to follow (alphabetical characters change into their uppercase counterparts), but some are not (numbers turn into symbols?). We take it for granted and we learned it by heart. Something that makes only half sense.

Layers in ZMK are more flexible, you can:

  • hold a modifier to change a layer (like shift)
  • press a modifier to change a layer
  • hold a modifier to change a layer, but act as a regular key if pressed
  • one-off layers — press a modifier to change to another layer for the next key only (e.g. instead of holding shift you press it and the next key will be shifted)
  • it’s not limited by high-level functionality either, you can go all kinds of crazy (e.g. shiftless, something that I tried to do for some time — to type an uppercase character instead of holding shift you hold the character key itself a little longer than usual; this approach has it’s fun, a flow, but it required more mental capacity than I could afford)
  • also: combos, macros, tap-dance, caps words, sticky keys, you name it!

Main Layer

The usual QWERTY except for' instead of :(quotes are used more than semicolons), the thumb buttons, and the home row modifiers.

The thumb buttons from left to right:

  • Extra layer when held, Tab when pressed
  • Symbols layer when held, Space when pressed
  • Backspace
  • Ctrl/Cmd

The reasoning behind this: I never need to press and hold Tab or Space keys, for coding a couple of tab presses usually suffice; backspace has to be easy and repeatable; Ctrl/Cmd I use all the time and has to be held.

The home modifiers — it takes time to get used to these (and tweak ZMK settings to feel good), the idea is that you hold d and press f to generate ctrl-f, it beats having these in less accessible, “classic” places likezand /. Notice the right-side modifiers are on the bottom row — I have to keep vim arrows hjkl “holdable” to be able to navigate faster, and I rarely use the modifiers on that side, only as a backup when a modifier and the following key are bound to the same physical key, e.g. Alt-f.

Symbols Layer

Numpad on the right, useful symbols on the left in the home row, brackets in the middle, and the rest are in familiar or symmetric places (e.g. \is on the other side of /on the main layer). Easy.

Extra Layer

I use alt-1..4 to switch desktops on any station I work!

The extra layer has all the non-alphanumeric stuff — enter, escape, vim arrows, media controls, etc. Some fun mnemonics for clarity:

  • At first, I’ve put escape on the d key, because I’m used to ctrl-d to exit a shell, but f worked better for me, and has a richer, more emotional mnemonic anyway.
  • This worked out well for the enter key too — because some messages you just have to send with a middle finger.

System Layer

Accessible by pressing the Extra modifier and then another one MO(3), I rarely use this layer.

  • Reset and bootloader buttons
  • Switch Bluetooth channel buttons. ZMK stays connected to multiple stations all the time, so you can switch immediately from one station to another
  • Forget current Bluetooth device button
  • Prioritize USB over Bluetooth connection (useful for gaming)
  • A numpad of F buttons

Caveats

  • * Not a pointing device! As much as I try to avoid a mouse — sometimes there is no choice. Not all is lost though Pimoroni Trackball & ZMK support are coming!
  • ** It’s small, I lose it all the time on a square meter area, and I sit on one of the halves on a daily basis.
  • *** I still tweak the balance of hold vs press on some keys (Tab/Extra layer especially, and sometimes shifts). The problem is not the keyboard but me, my typing speed is mood based and breaks the balance — quotes instead of shift, tab+d instead of enter, etc.
  • ****!@#$ It does break from time to time — usually, a quick 5m fix is all it needs (swap a switch, nudge the chip), but you have to have the replacement materials ready. I got stuck without a keyboard because I ran out of pins, the cheapest part.

Final Words

This is the keyboard I used exclusively for all my needs for more than a year now. I expected this project to be fun, I didn’t expect to finally find My Perfect Keyboard.

--

--