# Keyboard’s from a Maker’s Perspective

It’s been a while, and boy does it feel good to be back. I recently had my son, got a new job, and started up my business again. What little down time I have is spent pouring everything into my keyboard business. It’s been somewhat hectic, and rewarding. That’s what I wanted to talk about today, my journey into keyboards, and the things that I have learned along the way. I want to share those with you so that you can learn something new.

Anyone that knows me knows; I have always wanted to be an engineer. These days they call people like me “Makers.” Pretty simple. I make things. But one of the things I have been fixated on for the last 5 years is mechanical keyboards. It’s one of the more simple electrical engineering tasks that you can get your hands on.

A lot of people don’t think about how the things they use every single day work. Let’s jump into one of those things.

(I would like you to keep in mind, this is taken from the perspective of a mechanical keyboard builder. Some of these things do not apply to all keyboards but the premise is still the same)

## The Matrix:

The way keyboards are generally wired is by using a grid of rows and columns, known as a matrix. Each key gets assigned a row and a column, each row and column is scanned many times per second and looks for the intersections. I will be writing in this format, {Row , Column}. For example the top left key would be key {0 , 0} (Row 0 column 0) the one to the right of that key would be {0 , 1} the one under would be {1 , 0} and so on. It’s easier to think of it like battleship.

Please refer to this to see a 4×4 key matrix.

(0,0) (0,1) (0,2) (0,3)

(1,0) (1,1) (1,2) (1,3)

(2,0) (2,1) (2,2) (2,3)

(3,0) (3,1) (3,2) (3,3)

(The item that takes this the matrix scanning information, and turns it into something that your computer sees, is called a microcontroller; Commonly referred to as an MCU.)

The reason for doing things this way is to save space on the micro controller. You could very well wire each and every switch to it’s very own pin; Some keyboards do things this way. But you either need an MCU with a lot of pins or some kind of expander. Being that there is 1 pins for each switch, and Multiply that by most keyboards being 104 keys you can see why the matrix option is generally used. Instead of using 104 pins, you can cut that down to 22 pins using an 11×11 matrix.

The matrix option isn’t perfect though. You will inevitably run into ghosting. I won’t go into much detail, but a quick overview; Ghosting is when a key press either disappears, or outputs a totally different key if you press multiple keys simultaneously. Please see this write up or this one on the technical reason as to why this happens. Don’t fret though! This can be mitigated by using diodes. Usually this is a less expensive approach than using a large MCU or IO expander. What a diode does is allow electricity to flow in one direction, but not the other. You wire a diode to one pin of each key, and voila! No more ghosting.

Diodes are not the only way to handle this. It can also be handled in firmware. But for the sake of your time, and my sanity, I won’t be going into the firmware methods, as I don’t completely understand how this is handled in firmware. You can read the above links if you are interested.

## The MCU and firmware:

There are a ton of micro controllers (MCU’s) on the market. Of those MCU’s the ones you need to be aware of for the sake of keyboard building are the rewritable type that emulate USB HID’s. (Human interface devices. As in device that humans use to talk to the computer.) Now, I will shortly address the other types. When you buy a keyboard from say, Microsoft, it will have an MCU. The MCU’s that they use can usually only be written to once. Microsoft adds the firmware to the MCU, puts it in the keyboard and it stays like that forever.

MCU’s are very versatile, and can do all sorts of things, they can control robots, drones, lights, and screens. They can do machine learning and become internet routers. They can be used to make your own video game controller. But you know what else they can do? You guessed it! Become a keyboard!

What is firmware? Simply put, firmware is the software that talks to the hardware. In terms of a keyboard, It’s the middleman; The MCU’s firmware is sitting there like a child repeatedly asking the hardware “Is it clicked yet? Is it clicked yet? Is it clicked yet?” If the answer to that question is “Yes.” The firmware says “Hey computer, the button was clicked, do the thing.” Then the computer does the thing.

These days, there are a slew of firmware’s for many different MCU’s that are already made that you can use. All you really have to do is tell the firmware where you are putting the row and column pins, where they relate to on the physical keyboard, and what the keypresses on the physical keyboard are supposed to output to the computer. It does all of the other work for you, and unless you are putting something fancy on your keyboard, like a little screen, an encoder, or a mouse, that’s all you really have to do. Once you told the program the parameters, you flash it to the board, and you’ve got yourself a working keyboard.

## Keyboard sizes:

Keyboards come in a range of sizes. They are usually referred to by a % sign. Let’s go over the most common, and then the less common layouts.

• A 100% keyboard would be a standard 104 key keyboard.
• 87% or Ten-keyless (on account of it missing it’s numpad.)
• 75%. This is about as low as you can go without having to put other keys under a function layer.(A function layer is just a key that you hold down to get to other keys that are sorta “underneath” other keys) It still has all the F1-F12 keys.
• 65% Which chops off the function keys, but usually leaves you with arrow keys and keys like delete, page up, page down.
• 60%. This seems to be the most common keyboard amongst keyboard enthusiasts. It’s small enough that it doesn’t take up much room. Leaves you with all of the most commonly accessed keys on the base layer. This is about the smallest most people will ever go.
• 50% Most keyboards in this category lie under the “Orth linear” layout and are very similar to 60%. We’ll go over layouts shortly. If it’s not under the ortho category, it just has the modifier keys lopped off.
• 40% We’re in the danger zone. This is where people start asking questions. You’ve now ripped out that precious number row. Where did it go? How do you use that thing. (Please refer to aforementioned “layers”)
• Anything below 40%. These are usually have some kind of funky ortho layout. Do not use if you don’t like answering a million questions, and getting judged on a regular basis. (Do use if you use a keyboard for a living, and like the use of your wrists)

## Keyboard Layouts:

This is just how your keys are arranged. There are 3 main Layouts.

• Row Staggered: if you look down at your run of the mill keyboard, you may not have noticed. But it’s probably staggered. Check it out. See how the A key is not directly below the Q key? That’s staggered.
• Ortho-linear: The keys are basically just in a grid. Each key is directly next to the other. Please see this picture for a better understanding.
• Column Staggered: Instead of the keys above and below being staggered, the ones to the left and right of the keys are staggered. This goes with the natural curve of your fingers, thus a more ergonomic keyboard. Please see this picture for a better understanding.

When it comes to the word “Layout” it can also be referring to the way the keys are arranged. There are 3 main layouts in the English language. QWERTY, Dvorak, and Colemak. If you want a better understanding of why there’s different layouts. Please read this.

## The Good, The Bad, The Rabbit hole:

I also wanted to cover the “Fun stuff.” But first let’s look at the not so fun stuff first.

I just wanted to start this by saying, this hobby is all consuming. You walk in wanting a programmable Ten-keyless, and you’re left with a tiny little 30% keyboard, an empty wallet with 30+ keyboards of various different sizes now sitting in storage.

I am just going to rant for a moment. Maybe I’m just a hipster.

As with any hobby that becomes any level of mainstream, the goal stops being “Quirky, weird, and innovative” and starts becoming a fashion contest. I’m not sure when it went from the former to “Lubed switches”, “Thock”, “300 dollar ABS keyset”, and “60% only club.” There are so many wonderful cool keyboards that get lost in the sea of the same old thing. “How dare you post that odd looking contraption in our superior group. Take that somewhere else.”

So people do, and these niche groups grow Niche….er…..

But that’s the beauty of it. When the niche becomes even more niche, you find wonderful closely knit communities.

This hobby has been the perfect gateway into making electronics. If it weren’t for keyboards I don’t think I would have as good of a grasp on how electronic devices work. I don’t think I would be as far as I am when it comes to programming. (Although, to be honest, I’m really not that great.) I learned a lot about 3d modeling too. It’s just been a wonderful experience.

## The Ergonomics of it all:

You get into this hobby for 1 of 3 reasons.

1. The most common is to have a cool looking keyboard. If you got into it for a cool looking keyboard that also sounds good, then there is a good chance that you’re picking up a pre-built hot swap board, lubed switches, and some neat keycaps. Nothing wrong with that. Great way to get started, and it’s where most people stop.

2. Like me, your wrists hurt man. you spend all day on a keyboard, and you need something ergonomic. But the only way to find something ergonomic the way that fits you is to just make it.

3. You just love electronics and learning how the things around you work.

Since I fall somewhere between 2 and 3, let’s talk about ergonomics and WHY I eventually choose to use 36 key keyboard.

Why in the world would anyone choose to use a keyboard that small and how does it work?

I was diagnosed with Carpal tunnel syndrome in my early 20’s. For anyone that doesn’t know, it’s a repetitive strain injury that causes numbness, tingling, and pain in your wrists and fingers. When I realized that this was likely caused by my excessive use of a keyboard and mouse at work, I started searching for solutions. I started out with using trackball mice instead of a standard mouse. that alleviated a considerable amount of pain in my right hand, but my left hand was still aching and going numb regularly, and so was my right arm. At the time I was still building keyboards (60%’s of course). When I was at a mechanical keyboard meetup in Indianapolis I entered a giveaway, and I ended up winning a Planck (This is a 40% ortholinear keyboard). I jokingly said “Here’s my endgame.” I ended up building it and decided I would bring it to work to try it out. I never ended up bringing it back home. It took a considerable amount of getting used to, and my muscle memory was going haywire. But I stuck with it, and started to understand why it was a thing. The ortho layout over a couple of months made the pain dissipate. I stuck with 40% ortho for a couple of years, and in that time I ended up with a split keyboard. Being able to angle the keyboard made a lot more sense; and again, less pain.

After some reading, I found a video talking about sub 40% keyboards. Now I will list the advantages.

The main advantage is obviously the ergonomics. But what makes a keyboard with less keys more ergonomic?

Well, no key is more than 1 key away from any of your fingers. I never have to move my whole hand to get to any key on the keyboard. Staggered ortho makes every key even easier to reach too. If you combine that with it being angled to the natural way your wrist falls, you’ve got a recipe for comfort.

Now how does this work? How do you get to your modifier keys when you only have alpha keys? Well we use layers, mod taps, tapping keys, combo’s multi-function keys, and macro’s to achieve this. This can be done in many different ways for different people. But I attempt to explain the way that works best for me. I won’t be explaining all of these different functions, but you can explore them in the QMK firmware docs.

Your thumb’s are incredibly underutilized on a keyboard. Most people use only one of their 2 thumbs to press space bar, and that’s the only thing they do. For me my thumbs do all sorts of thing. I have a thumb cluster of 3 keys per hand. On my left side I use it to press space, to get to my “unshifted layer” (More on that later) and the control key; On my right side, I have backspace, my “shifted layer” and alt key. The key that represents the letter Z on my keyboard also functions as a shift key when it’s held down, and the key that represents slash or / on my keyboard does the same thing. If you hold down shift and hit backspace, you get the delete key. If you hold down both the “shifted” and “unshifted” layer keys at the same time you get to a whole new layer that gives you access to some macro’s like CTL+ALT+DEL, WINDOWS+SHIFT+S and the F1-F12 keys; Along with some less common keys.

Let’s talk about those “shifted” and “unshifted” layers. My unshifted layer accesses the number row of keys along with dashes (or “-“) and some of the other keys like brackets. It also gives me access to arrow keys on the home row. and the windows key. The Shifted layer gives me access to shifted keys, like !@#\$%. I ultimately only need 3 layers to access every single key that a normal sized keyboard uses. Given some time and practice it all becomes second nature.

You get some other useful unintended side effects too. Using something ergonomic forces you to type the right way and use all of your fingers. To this day I still don’t type the right way on a normal keyboard. The muscle memory for a normal keyboard is still there for me. (Although your results may vary) But when I use an ergo keyboard, I type correctly. This has led me to go from an average typing speed of 60wpm, to over 100 a lot of days.

Retraining your muscle memory takes time, effort, and headache. Once you get through it though it’s wonderful.

I hope you enjoyed my ramblings, and I hope to see you in the keyboard community, no matter where you end up going with it, you’re all welcome in my book. (So long as you’re welcoming to others.)