DEV Community

Cover image for Better keys
Jakub Stibůrek
Jakub Stibůrek

Posted on

Better keys

As a self-taught software engineer I'm quite used to having a different view on certain topics than my peers coming from technical backgrounds. Most often it's about our approach to organising work or communicating rather than the coding itself. One of the first things that have struck me when I started to code, even when I wasn't a professional yet, was the health issues and that a lot of IT professionals ignore them. Working as a SW developer inevitably means hours spent in front of a computer every day. So I looked at my desk and the things that I use to produce code. I saw a monitor, keyboard, computer, table and chair and I thought about the ways I can improve these to not get the carpal tunnel syndrome (or many more health problems induced by this way of life) in 10 years.

I actually started with my monitor and not the keyboard because I was using a laptop back then and I was going to get a second monitor. My primary focus wasn't to get the highest frequency or the best colours. Don't get me wrong I wanted to get the best product I could afford but mainly I wanted a monitor that would go easy on my eyes. I purchased a monitor that can adjust contrast and brightness on the fly based on the conditions in my room. Looking back I would get a different model because I now don't use two or three monitors setup but a single big one (at the office) and the one I have at home is too small for my liking. But still it's quite pleasant to look at it in the evening when the light in my room is dim. My eyes don't hurt even if I don't use a dark theme in my IDE (yes, I'm a light-theme-using psycho). And the monitor can be easily moved up and down to be at the right level for the person using it.

Down the rabbit hole

Soon after I've got myself a second monitor (so I had a laptop and two monitors on my table) I decided that a standalone keyboard would be more practical than using the laptop build-in even though I was pretty content with it. I went to a local computer shop and tried a few displayed keyboards. I found out that there are basically two kinds of keyboards out there: mechanical and membrane. And so my journey to the mechanical keyboard realm has begun. Anyone who owns one must know how treacherous and deep this rabbit hole is.

Well initially I didn't know of course... and I got myself a gaming mechanical keyboard. Low profile stacked with shiny LEDs that would be enough for an entire U2 show. It was kind of expensive compared to a basic 10€ membrane keyboard but still cheap for a mechanical keyboard. And it broke soon. Some keys stopped working and I was pissed. Unfortunately I couldn't return it because I tried to fix it and I messed up and broke it even more. But as I poked the thing and I googled a few things I found out that the switches (that's what goes clickity click when you press a key) are actually not very common even for a low profile keyboard. You see there is two or three common interfaces that connect a switch to a keycap and those I had on my first keyboard were some knockoff that wasn't compatible with anything. So I had to get a new keeb. And I was just starting my research on the mechanical wonderland.

Why?

I'd like to briefly explain how these keyboards work and what kinds are there available but before that I want get to what initially made me buy a mechanical keyboard.

When typing on most membrane keyboards and predominantly on laptop keyboards the feeling of pressing a key can be mushy, sometimes keys respond to any slight touch, some keyboards bend, keys rub one another, etc. the main point is that you get what the manufacturer serves you, like it or not. And I just felt like I want a keyboard that would fit me and my hands. The mechanical keyboards are produced usually in a small quantity by invested people for their peers, you have to often put them together yourself but even if they are pre-built you still have some degree of control. You can choose the size of the keyboard, maybe you don't need a function row or a numpad... you can choose the switches, how hard are they to press, whether they make sound or not, haptic response, how precise are they and so on.

At the beginning I didn't even know what else I can customise, yet I was already sold on the idea of custom keyboard.

Mechanical switch

How does a membrane keyboard work?

Mechanical switch actually predates a membrane keyboards. It was the original way how keyboards were made.

So a pro tip: If you want a mechanical keyboard and you are on a tight budget, just get an old keyboard from 80's or 90's from your local used electronics shop.

Nowadays keyboards are usually membrane. That means that a key is actuated by two thin metal pieces touching. This design has many advantages over the mechanical keyboards. Firstly it's much cheaper, it's thinner and it's quite durable. You can even prevent it from short circuiting when you spill a coffee on it quite easily.

This diagram shows how a membrane key actuates.
Membrane keyboard diagram

How does a mechanical switch work?

Cherry MX linear switch gif diagram

You can see how a mechanical switch actuates when pressed on the diagram above. This particular switch is called Cherry MX Red and it's a very popular switch used e.g. in pro-gaming. It's so called linear switch. Meaning that the moving part is traveling from the initial position to the actuating position with no obstruction along the way. These are very precise and that's why they are popular among gamers.

Cherry MX tactile switch gif diagram

The second kind of a switch is so called tactile, this particular is a Cherry MX Brown. These switches have a little bump on the moving body which upon actuation gives a haptic response to the finger. I personally like the feel of pressing a button which these tactile switches provide and I think they are the best kind for typing.

Cherry MX tactile clicky switch gif diagram
Source of the gifs

The third diagram shows a Cherry MX Blue which is a tactile and clicky switch. Unlike the linear switch this one is not silent. You can see that the moving body is made out of two parts. The white part jumps when the switch actuates resulting in a quite loud click which you either love or hate. Either way I don't recommend using these in an office. You might get hit by a mere basic Logitech keyboard in the face.

Here is a nice video explaining the difference between a mechanical and membrane keyboard.
Mechanical vs Membrane Keyboards: Are Mechanical Keyboards Worth It?

Layout

Have you ever looked at your keyboard and wonder why is that the letters are arranged in this particular way? Why is the top row widest and the second and third row slightly thiner and kinda shifted to a side? Why is the space button so big? The questions could and should go on. You can find many videos on the internet explaining why QERTY keyboard layout has won the most used layout prize. TLDR is that we just got used to it. But since you have already read all the text above this paragraph you know that can't stop me!

I wasn't ever taught how to properly touch type. I have learnt to somehow type fast and even without looking at the keyboard myself as a lot of people do. This might sound like a disadvantage but actually that means that when you want to learn to touch type properly you can consider yourself a clean sheet. You don't have to limit yourself to a status quo layout, learn some DVORAK maybe.

Yeah there are many alternative keyboard layouts that have been put together by a chance, method of science or compulsive need for symmetry. You can even try to create your own unique layout since you are building your keyboard, you can have your layout as well. I even tried to do it the scientific way. I took my mother tongue (Czech) and got some data on the frequency of letter occurrence and their combinations then I laid those most frequent on the home-row (that's the starting position for your fingers when you lay them on the keyboard, on qerty it's 'asdfghjkl;'). Then the less frequent on the edges and so on. Unfortunately I have never actually tried this layout. I soon realised that I write more English on my keyboard than Czech and I need to write a bunch of special symbols since I'm a programmer. So I gave in on creating my own layout.

And on top of that I realised that even though I'm going to have my own special keyboard I still would from time to time need to use a laptop keyboard or someone else's keyboard and it could be quite hard after I've spent some time learning some totally different layout. So in the end I personally have kept using QERTY on all of my custom made keyboards and I don't have any trouble using the standard keyboards. (Unless they don't have English legends, then I'm lost.)

Nevertheless I strongly support use of alternate layouts and perhaps one day I'll also switch.

BUT you don't have to give in to the peer-pressure all the way. There is still one distinct problem of the standard kb layout. The width of lines and the shift (which is called stagger). It bothered me that to write 'FRV' my left index finger would have to go up and left and then down and right. Try it. This is so unintuitive and awkward. Remove the stagger and align the letters in neat columns and you get an ortho-columnar layout. Much better.

orthocolumnar layout

This was but a beginning of my 'ortho' journey. But if this is already something you'd like to use there is this keeb preassembled and easy to program.

End game?

After I've spent some time typing on a mechanical keyboard, but still the standard qerty staggered layout, I've done the aforementioned research. I've found out about alternate layouts, staggerless ortho-columnar keyboards and finally about split keyboards. As I've mentioned before my end goal is to have my keyboard, meaning I wanted a keyboard that would fit me, no factory made standard bs. And one of my biggest concerns from the beginning was health. I knew going in the programming career that I'll spend thousands of hours typing and siting (actually I've a standing desk so some standing is going on as well) in front of the computer and I want to minimise the consequences of this lifestyle. Kinda like sportsmen know about the stress their career puts on their body and so they take precautions.

A split keyboard consists of two halves. They can be completely split and connected via bluetooth or a cable or they can be kinda still together but separated by a few inches of plastic. My keyboard(s) are split and connected by a TRRS cable.

Kyria keyboard

This model is called Kyria and you can get a DIY kit here.

Why have I chosen to build and use Kyria. Such a weird keyboard... it doesn't even have a legend on the keys. Is there enough keys for everything that I have on my laptop keyboard? I get you. I've listened to people admire the weirdness and also to just laugh at it. Let me explain how it works and what are the benefits.

The white keys are standard qerty layout so if you can touch type, you can use this keyboard just right to type. There is no big space because there is no real need for it on a modern keyboard. On this kb space is one of the blue keys in the left thumb cluster. The blue keys are either modifier keys like cmd, shift, ctrl, etc. or a layer swap keys (I'll explain layers soon) or some kind of macro key. I have for example a macro to switch input language to Czech and back to English. I have a macro for signing out of my computer.

The arrangement of the keys, as you can see, is ortho-columnar and I've talked about the benefits of that but they are not ortho-linear. The stagger on Kyria is much different from the standard columnar stagger which serves no real purpose. The linear stagger is used to compliment your fingers because they are, as you may have noticed, not of the same length. So the layout basically copies the shape o your hand. One way of going even further would be to not use a pre-designed kb like a Kyria but to design it from scratch to match your hand exactly. I might once get there.

Now where the hell are numbers, function row, brackets... that's where the layers come in. The idea behind Kyria is that your fingers never have to travel more then one key from the home row to type anything. So using a firmware like QMK or ZMK we can program the keyboard to do anything and one common technique is to create multiple contexts (layers) which change the behaviour of the keys. You then assign some keys (in my case those in thumb clusters) to switch the contexts. So to write down (35-45) I have to switch from my querty layer to brackets, special and numbers characters layer. It takes some learning but in the end it's very effective.

Here are some of the layers that I have programmed for my kbs.

keyboard layout

keyboard layout

keyboard layout

You may think that I've already taken it to the extreme but check this mad lad out.

Is this the end game for me? Have I found the right keeb for myself? At the moment I'm pretty content with what I have. I'm experimenting from time to time with some modifications like a rotary encoder etc. and I was thinking about building another keeb that would have the number row because Czech special characters are quite hard to tackle using the layers or key combos and on standard keyboards the number row is where these are located.

Conclusion

There is many ordinary things around us that we've got used to never change and often changing them would probably bring more harm than benefits. As engineers say "If it works don't change it but pretend like you did.". I'm looking at you Apple. BUT sometimes trying to look at such an ordinary thing as a keyboard from a different angle may pay out. I have to admit that this journey, have it not become my hobby as well, would be tedious. The total customisability always comes with a lot of work. You should consider whether this is a thing that you should spend time on. If you can't or don't want to spend too much time building your very own keeb, there is a bunch of options which are somewhere in the middle, you can customise them but only in some aspects, e. g. Ergodox have a split keyboard that you can program to your liking.

Ultimately I hope this article have entertained you and perhaps gave you some insight in the realm of mechanical keyboards.

Top comments (0)