Key mapping

August 28, 2019

I have a new favourite toy.

KBD4X keyboard KBD4X keyboard


This is a KBD4X, made by a company called Kbdfans. It is a 40% keyboard, meaning it lacks a lot of keys you expect to find hanging around the outskirts of comfortable hand positioning. To get the most - or anything, really - out of a keyboard like this, you need to program it yourself. That means figuring out where you want each function of a keyboard to be, deciding how exactly to invoke it, then editing a C file, compiling a new firmware, uploading it to the keyboard itself, and trying it out.

KBD4X next to Das Keyboard KBD4X next to Das Keyboard

Oh yeah, it is also pretty small compared to most other keyboards. And it has the keys in straight lines - ortholinearity, as the hipsters call it - just to make getting used to it a little bit more challenging.

I was expecting all this to be a challenge, especially since I never managed to get comfortable enough with my Pok3r to use it regularly.

I did not, however, expect to make progress this fast, or to have anywhere near this much fun figuring out and programming my layout.

Enter QMK

QMK is the open source firmware supported by this and many other keyboards. Programming your own firmware - in C, no less - sounds like a daunting and dangerous undertaking, but thanks to good guides and tools it is actually pretty easy. Perhaps most important of all: once you have the initial setup done, the iteration cycle is really quick. Making a change, compiling and updating the keyboard is a process of seconds, which makes trial and error highly enjoyable.

Getting into the keyboard

The look and feel of the keyboard had me hooked right away, I love the size of the overall board as well as the keys, and of course it has a wonderful clickiness from well-chosen key switches. I bought the keyboard including switches from a friend, so I can never remember which ones they are, but it is one of the relatively silent models. I have ordered even clickier ones because I am curious about the change in feel, but I truly have nothing to complain about now, and I do think the slightly quieter keys are an advantage in many situations. I got the keyboard set up during my summer holiday, but I decided pretty early on that to really learn and get into something this different, I should really use it at work. I was, however, deeply unsure about how that experiment would go. It seemed pretty likely that I would try for a couple of days, then notice I was using other keyboards most of the time, sigh, bring the keyboard back home and only use it for irregular bursts of writing.

Happily, that turned out not to be the case. At the time of typing, I am halfway through my second week of use, I have disconnected the other external keyboard, and I wish I had the same keyboard at home without needing to bring it back and forth.

I have got the hang of the keyboard quicker than I expected, but my keyboard layout has also changed a lot more and a lot faster than I would have guessed. It turns out keyboard layouts are a lot easier to remember when you have created them yourself, and so I have found myself repeatedly making both large and small changes throughout the week and a half without descending into complete confusion about which button does what.

My current layout

My layout is still evolving heavily, but I figured I could benefit from starting to document it at some point, both as a reminder to myself and as a possible source of inspiration for others. The illustrations are created using the online Keyboard layout editor.

Base layer

The base layer of my layout

This is what happens when you just hit the keys, and it looks pretty normal except having way fewer keys. L1 and L2 are layer switch keys, when I hold one of them down the corresponding layer is activated, providing me the keys on that layer instead. Tab acts as you expect when tapped, but activates layer 3 when held down. In all three cases, the layer switches back to the base when the key is released.

The main obvious thing missing here for a Swede are the three characters å, ä, and ö. I type in Swedish a lot, and so their usage frequency really motivate a spot on the base layer. So far, however, I have been unable to find a suitable place for them. I had them just to the right of M for a while, but found it much easier to get used to the position they have now on layer 3, so I put some special characters on the base layer instead. Time will tell if they return eventually.

I also regularly miss dedicated arrow keys, but even though I still do not use them very efficiently I feel less inclined to do the amount of reshuffling required to fit them in.

Layer 2 - Numbers and shifted numbers

Layer 2 - Numbers and shifted numbers

Nothing too strange here, the top row are the number keys in their usual places, the second row are the number keys with shift held down, so that characters like " and ! do not require three keys to type.

This whole layer is actually becoming a candidate for removal, now that I have the numpad layer and the shifted keys available in other places.

Layer 3 - Arrows, Swedish and more

Layer 3 - Arrows, Swedish characters and assorted specials

The current home of both the arrow keys and å, ä, and ö. I really enjoy the reachability of the arrow keys on the home row, but I find it very hard to get used to having all four on a line rather than the classic inverted T shape. I will probably try putting them in T shape somewhere at some point, but I do not really want to break the line of shifted numbers, nor move the arrows down another row. We shall see.

Layer 4 - Numpad

Layer 4 - Numpad

I am not sure why I like this so much, but I do. Entering numbers somehow becomes a bit more fun with a numpad setup, and it immediately started feeling weird that I had always needed two hands to reach all numbers before. I am going to add some common separators on this layer as well, so that I do not need to switch back and forth to write currency values, dates with separators and so on.

What remains?

Am I done? Not nearly. Like I mentioned in several places, I still feel my layout has room to improve. And of course I just need to simply write more to get more used to all key placements. Regular text entry is doing pretty well already, but special keys can be very slow.