What makes a keyboard layout good?

2023-12-11 Mon 00:00

Table of Contents

This question gets asked very often by newcomers to alternative keyboard layouts, and for good reason. Most popular coverage of layouts is over-simplified at best, and at worst completely wrong. Annoyingly, even layout creators themselves can be misleading with how they present the quality of their layouts. This post intends to give a brief, clear, and correct introduction to layout metrics.

What's the point of layouts anyway?

To understand what makes a layout good, we need to first understand the point of alt layouts.

An extremely common misconception is that alt layouts exist to make typing faster. While the question of speed improvement from alt layouts is debatable, the short answer is: do not switch layouts if all you want is to be faster at typing. You are far better off just improving your speed on your current layout.

What layouts do improve upon is typing comfort. For those with or at risk of hand injuries such as RSI, alt layouts can make a huge difference. Although my hands are perfectly healthy, I have found alt layouts to be so much more comfortable to type with - which has made typing fun for me. QWERTY, by comparison, just feels awkward and uncomfortable.

So, the point is to improve comfort. Let's talk about how specifically layouts optimize for this.

Individual finger usage (frequency, SFBs, movement)

The most basic metric that layouts optimize for is the usage of individual fingers. I'll split this into roughly three perspectives: basic key frequency, same-finger bigrams, and overall finger movement.

Finger frequency is an extremely superficial metric, and you shouldn't be impressed much by it. It is simply how many keys each finger types on average compared to other fingers. This metric is important for balancing the workload across fingers. Generally, most people prefer a distribution of least work on pinkies to most work on indexes. The exact amounts each finger uses are mostly preference.

Next is one of the most important metrics in layout analysis. Same-finger bigrams, commonly known as SFBs, are instances of pressing two keys in a row with the same finger. For instance, most people type qwerty ed with only the left middle finger - this is the most common SFB in QWERTY.

Almost everybody agrees that SFBs are uncomfortable. They are also objectively slower than other bigrams at peak speeds. Because of this, layouts focus most of their optimization on reducing SFBs. While QWERTY has a total of 6.1% SFBs, Colemak has only 1.7%, and even more SFB-optimized layouts like Graphite have under 1.0%1.

Finally, I want to briefly mention overall finger movement. While SFB is a great metric, it is a little oversimplified. It does not include the distance between keys, and it only accounts for same-finger pairs which occur right next to each other. Some analyzers can measure weighted finger movement, such as Oxey's Oxeylyzer.

Finger relations (alternation, rolls, redirects)

While individual fingers are important, comfort is also greatly affected by the relations between fingers. This is more than just the left/right hand balance. There are many metrics that exist, but I'll go over the biggest three you'll hear people talk about.

Alternation refers to how much you switch hands during typing. You want this to be pretty high, as long sequences on one hand are uncomfortable. However, too much alternation (switching hands nearly every key stroke) can be uncomfortable. Because of this, many layouts try to balance alternation with rolls.

Rolls are motions where multiple keys are hit in a "rolling" motion on one hand, like er on QWERTY. Many people find this motion very comfortable. There is also a distinction between inward and outward rolls. Inward goes from pinky to index, like er, while outward goes from index to pinky, like no. Some find inward more comfortable than outward, but this is completely preference.

Redirects are three-key motions that change between inward and outward directions. For example, the most common redirect on QWERTY is you - it starts outward with yo, but changes to inward with ou. Many people find this general pattern very undesirable, so layouts often minimize redirects.

Lateral movement

This is a relatively minor metric, but it's a big deal to some. The index fingers are required to work more than the other fingers because they have 6 keys each instead of the normal 3. Unlike other fingers, this means they can move laterally instead of just up and down. Some people find this uncomfortable, especially when a reach with the index finger inwards is paired with an adjacent middle finger keypress. This is known as a Lateral Stretch Bigram, or LSB.

Some older layouts have made the mistake of putting common keys on the inner homerow (QWERTY g and h positions), as if they are the same as the other home positions. This is wrong, and causes higher LSBs. Colemak DH is a mod that exists to fix this issue.

Case study: Dvorak vs Colemak

Dvorak and Colemak are two of the most used alt layouts. Let's compare them together! I'll be using Oxey's Layout Playground online.

Let's start with Colemak. layout_playground_colemak.png

Colemak's finger distribution is heavily index oriented, being nearly 20% per index finger. The middles, rings, and pinkies all share the rest of the load fairly even. This is a pretty typical distribution from a layout made before 2020, and a lot of people like it a lot. However, some (like me) find it too much index usage and prefer more balanced fingers.

Colemak has less than 1.4% SFB - this is pretty good! It's not spectacular compared to some more modern layouts, but it's respectable.

Colemak's rolls are still pretty high for modern standards, and it's inward focused, which many people like.

However, it has very high redirects - 9% is nearly as bad as QWERTY. The trigrams "you" and "ion" are common annoyances for Colemak users.

And of course, d and h being in the center columns leads to a somewhat high LSB count.

Overall, Colemak is a great layout with a few minor flaws (again, the LSBs are addressed by the DH mod).

Now, let's compare Colemak to Dvorak. layout_playground_dvorak.png

Right away, you should notice something strange in the keymap - i is in the center column, lower priority than the far less common u. This is bizarre and I don't have any idea why it's there. What I do know is that this causes too much lateral stretching, and I found it rather annoying when I tried Dvorak.

Dvorak also has very high pinky and ring usage on the right hand. rnv all on the same finger will lead to quite a lot of movement - consider a word like "curving". Overall, there's a pretty big movement imbalance between the heavy right hand and stagnant left.

Additionally, SFBs are way higher than Colemak - 2x the rate! This is ridiculous; there is absolutely no reason for a layout to have above 2% SFB. ct, gh, and ls are among the most frequent and noticeable.

Alternation is quite high, which makes sense for a layout designed for mechanical typewriters. As a consequence, redirects and rolls are lower than Colemak.

Overall, Dvorak isn't terrible, but it definitely shows signs of its age. It really doesn't win anything over Colemak besides lower redirects, but there are far better modern options if you want that.

I don't blame August Dvorak - his research was largely the first of its kind, he was optimizing for a completely different device, and he didn't have computers to help him like we do now. Nevertheless, we can conclude pretty confidently from this example analysis that Colemak is overall better than Dvorak.

Conclusion

This covers the very basics of keyboard layout analysis according to what I consider modern layout theory. This is unapologetically from my perspective as a layout creator and someone involved in this field for over three years now. Many of my opinions are shared with those in the AKL Discord (see the next section). There are people in different communities who disagree with me on several things - I think they are wrong. I'm happy to have friendly arguments with anyone! We both lose by default anyway for being nerdy enough to argue about keyboard layouts of all things.

I intend to write many more posts in the future to make what I've been researching and discussing for years more accessible knowledge. If there's any particular thing you want to see me write about, please suggest it!

Further information and contact

  • If you're looking for an extremely thorough document with copious amounts of information on layout design and theory, look no further than ec0vid's excellent Layout Doc.
  • If you want to talk to others about layouts, you can find me and many other cool people on the Alt Keyboard Layouts Discord!
  • Or, if you want to talk to me directly, feel free to send me an email at semilin@disroot.org.

Footnotes:

1

Data from Oxey's Layout Playground using the Tr Quotes corpus.

Date: 2023-12-11 Mon 00:00

Emacs 29.1 (Org mode 9.6.9)