carpalx - keyboard layout optimizer - save your carpals
Carpalx optimizes keyboard layouts to create ones that require less effort and significantly reduced carpal strain!

Have ideas? Tell me.

the best layout

Partially optimized QWKRFY and fully optimized QGMLWY layouts are the last word in easier typing.

the worst layout

A fully anti-optimized TNWMLC layout is a joke and a nightmare. It's also the only keyboard layout that has its own fashion line.

download and explore

Download keyboard layouts, or run the code yourself to explore new layouts. Carpalx is licensed under CC BY-NC-SA 4.0.

layouts

Download and install the layouts.

carpalx — design your own keyboard

Save your carpals and reach typing guru status with your own keyboard layout, such as the fully optimized QGMLWB layout. Alternatively, use your power for evil and create a carpal-breaking TNWMLC layout to embarass office prima donnas and punish sluggish workers. And TNWMLC is the only layout with its own line of Brazilian clothing.

Purpose of Carpalx

The carpalx project introduces a quantitative model for typing effort and applies it to (a) evaluate QWERTY and popular alternatives, such as Dvorak and Colemak and (b) find the keyboard layouts that minimize typing effort for a given set of input documents. In the work presented here, these documents are English text, but they can be anything, such as corpora in French, Spanish and even programming languages, like C or Python.

While there are many alternate layouts, the Carpalx project proposes new layouts and a fully-baked parametric model of typing effort. Way!

Carpalx in Brazilian Fashion

In a collaboration that brings keyboard layout design and fashion together—what a combination!—Brazilian designer Julia Valle used the carpalx worst layout (TNWMLC) as a design element in her Winter 2011 line.

The work was shown in a show in Rio de Janeiro. Julia accented the clothes with beautiful necklaces made out of parts of an 1956 Smith Corona typewriter.

This project is nearly cosmic in alignment of eclectic interests. Keyboard layout research is subverted to generate the most difficult English layout, which is then transformed into beautiful clothing design. This cross-pollination of ideas has particular meaning to me, since I once dabbled in fashion photography.

QWERTY — you're fired

Try typing "stewardesses". Tough, eh? Type the word several times and your left hand will need a break. Now type "chrząszcz" (Polish for "beetle"). Nearly impossible, eh? Type the word once and you've had enough. The problem isn't you—it's your keyboard layout. Well, maybe it's you but solving that falls outside my mandate.

Figure 1. The ubiquitous QWERTY keyboard layout. Chances are good that your keyboard layout is based on this arrangement of keys. If your language isn't English, your layout may differ significantly from QWERTY.

The QWERTY layout is a boon and a bane. It is a boon because it's everywhere and, if you learn to type on it, your skill is portable. It's a bane because its design makes typing more difficult than it should be. It's also the subject of an urban legend, which states that the origin of QWERTY can be traced to the mechanical design of typewriters. The layout was chosen to slow typists down and reduce jamming. I myself am guilty of subscribing to this myth until Andrew Dennison pointed me to a Smithsonian Magazine article The Legend of the QWERTY Keyboard, which tells the full and real history of the layout. Hint: it's not the typewriter that influenced the layout but the way in which it was used.

Of course, the limitation with any layout is that it excels for only one kind of text (e.g. English). If you spend your time typing two or more different languages and maintain the same layout, one of the languages will be more difficult to type. If you are writing computer code, it's likely that the code is significantly different (in terms of character frequency and combination) than your spoken language. Although interpreted languages like Ruby help reduce the noise found in other languages like Perl (I like both!), it's still likely that frequently used characters in programming (e.g. = + -) continue to be relegated to the backwaters of the keyboard.

In these pages, I will explore other layouts and indicate their strengths and weaknesses. I will also propose a few new layouts that were derived computationally using the carpalx typing effort model.

History of Carpalx

Redesigning a keyboard layout isn't as simple as 1-2-3. The real difficulty in layout design lies in defining how to measure typing effort. In other words, given a set of constraints it is easy to find a layout that minimizes them — it's defining the constraints that is hard!

I originally started working on Carpalx to determine whether I could recreate the Dvorak layout by developing a model of typing effort. My initial (and naive) hope was to create a parametric model that, when tweaked just so, would create Dvorak. In other words, I wanted to know what set of variables were minimized in the Dvorak layout.

When I ran the optimization for my initial model design, I quickly obtained keyboard layouts that had a much lower effort than Dvorak — in other words, I improved on Dvorak (according to my model) immediately. Furthermore, it quickly became clear that hunting for a model that would generate Dvorak was a hopeless task, because the number of models, unlike the number of layouts, is uncountably infinite. I adjusted my goal, therefore, from hunting for a model to creating a justifiable typing effort model and using it to hunt for the best layout. Could I find a layout that improved on the much-lauded Colemak?

Carpalx is a Perl script which reads in model parameters and performs a stochastic simulation to find a layout that minimizes the effort score for a given set of model parameters.

Statistics vs Human Factors

The statistics that Carpalx uses attempt to capture the essential human factors of typing. Fundamental considerations like finger travel distance and symmetric hand use can easily be agreed upon. More nuanced ones, like finger rolling and curling vs extending are harder to pin down — but extremely important. It's realtively easy to improve on QWERTY. It's much harder to refine a layout that already achieves all the fundamental improvements. already good layout.

The Workman layout incorporates advanced human factors and discusses their application to Dvorak and Colemak.

In conversation with Stephen O'Connor (Sep 2011), who has analyzed the Workman layout, I've been persuaded to seriously reconsider the parameters in my effort model. In particular, the model does not consider the possibility that the index, middle and ring fingers have different prefered motions, for a given travel distance. For example, most will agree that the ring finger prefers to extend for the W rather than curl to the equidistant X. On the other hand, the index finger has easier access to V than R.

Learning About Carpalx

There is a lot of content here, spread across many pages. I suggest reading pages in the following order

methods

Evaluating fitness of keyboard layout

Introduction to the typing effort model

List of existing and optimized layout alternatives

layout evaluation

Evaluation of the QWERTY layout

Evaluation of the Dvorak layout

Evaluation of the Colemak layout

Comparative study of all popular keyboard layout alternatives

layout optimization

Introduction to simulated annealing, the algorithm used to optimize a layout

Partially optimized layout (QWKRFY) - 5 key pair swaps

Fully optimized layout (QGMLWB)

Layouts that improve Colemak (PBFMWJ and GYLMWP) - mobile and stationary ZXCV

Worst layout for English (TNWMLC) - typing hell

component optimization

Evaluation of optimal layouts for individual effort components

running carpalx

Download carpalx code

Installing and running carpalx

Using carpalx to evaluate layout fitness

Using carpalx to optimize a layout

Interpreting the results

Creating images of layouts

Concurrent optimization on a multi-CPU system

Methods Behind Carpalx

I used existing keyboard layouts such as QWERTY, Dvorak, Colemak, Arensito and others, to help generate a model of typing effort. By evaluating these layouts using candidate models, I could determine whether the models were.

For example, it's widely known that Colemak is easier to type on than QWERTY and I made it a requirement that any model would corroborate this (obviously). Moreover, I built into the model certain layout characteristics that were universally seen as advantageous. While some layout characteristics remain disputed (e.g. how frequently should the pinky be used?), others such as reducing finger travel distance (by increasing use of home row), reducing same-finger row jumps and reducing repeated finger alternation on the same-hand hand can be agreed upon. These and other features form a list of beneficial layout characteristics.

Carpalx uses a parametrized model to account for finger distance, hand/row/finger penalties and stroke path penalties to accomodate different habits of typists. Those with disadvantaged fingers (hurt or missing) or hands (hurt or missing; a missing hand is ultimately debilitating unless you use a one-handed keyboard). Carpalx uses simulated annealing, a type of Monte Carlo optimization, to discover a keyboard layout for which the effort of typing the input documents is low.

Some of the desired improvements that can be directly influenced by the model during layout optimization in carpalx include

  • increasing hand-alternation or at least hand-balancing
  • reduction in same-finger typing
  • improve finger flow, such as finger rolling
  • increasing use of stronger typing fingers and reducing use of the pinky
  • limiting difficult stroke paths during typing, such as upward row progressions (e.g. nse)

Over time, the model evolved to be measure the extent of desired (and undesired) properties by three distinct effort components: base effort, penalties and stroke path. These components make up the total typing effort and evaluate a layout. For example, the comfortable key stroke combinations (e.g. 'afj' is a nice rolling motion, while 'but' is not, and 'omy' is very uncomfortable) are measured using the stroke path.

Figure 2. The QGMLWB keyboard layout. This is one of the optimized layout for typing English text. Using several classic novels as a training set and balanced typing model parameters, minimization of typing effort was done by allowing letter keys to be relocated. This layout destroys QWERTY and improves effort over Colemak by 5%.

Carpalx was designed to investigate better layout for English text. Therefore, it does not support independent migration of a key's shift states. Carpalx currently understands one shift state (for capitalization) but the lower case and upper case characters are always bound to the same key. Identifying optimal layouts for languages that make use of diacriticals (è é ë etc) by allowing both character and diacritical keys to migrate independently is not currently possible.

Ranking Words

Carpalx uses a variety of statistics to characterize a layout's performance. While quantitative and therefore directly comparable, these values can be hard to interpret and translate to typing in practise.

The algorithm itself is very flexible—it's a Monte Carlo (non-deterministic) optimizer. Ideally, what it should optimize isn't an abstract typing effort but rather directly the actual meaningful metrics like hand asymmetry, hand/finger repetition, row jumping and so on. It turns out that these are all improved by the algorithm, but through the effort metric as a proxy and not directly.

To give a more subjective impression of a layout's fitness, I have, in addition, ranked words based on the effort (per unit length) required to type them. I have ranked words for QWERTY, Dvorak, Colemak, QGMLWY (fully optimized, Colemak-like), TNWMLC (worst layout for English).

Some of the words are tabulated below. Keep in mind that word effort was calculated here per unit length, and is therefore not proportional to the length of the word.

layout words, by ease of typing
easiest average hardest
QWERTY alleges, fiddle, jiffle, kiddie ingent, limnery, pignorative, sumphishly pazazz, pizzazz, poppas, razzer
Dvorak condensity, equation, ethion, theist defile, fiddleys, suborder, unenviable allvar, lazars, plazas, razzly
Colemak desiring, sentry, steeps, stints implete, leafgirl, mythify, odours cazzie, pazazz, pizzazz, razzle
QGMLWY anneals, arbitrator, attend, neatly besigh, incursive, lauder, sparing buzzwig, fizzle, puzzle, zyzzyva
TNWMLC bedbug, culmed, jazzed, knocking, wizzen bunglesome, flouting, grunewald, miltier hetter, sheeter, teeter

Benefits of a New Layout

I'm neither the first nor last person to search for a better keyboard layout. Consider the Dvorak, Colemak, Arensito, or Capewell layouts.

If you spend a great deal of your time typing QWERTY and experience pain and discomfort due to the repetitive nature of the task, consider using one of these alternate layouts, such as Colemak or one of the fully optimized layouts presented here. A new layout will

  • immediately and significantly slow down your typing, giving your fingers and wrist some much needed rest
  • the accompanying frustration in learning the new layout will make you take more frequent breaks from typing, thereby giving your fingers and wrist even more of the much needed rest

Then, as you gain experience with the new layout, it will

  • reduce the effort of productive typing, for documents within your specific domain (you train carpalx using a learning set), and
  • ensure that nobody else uses your keyboard

If your goal is to achieve the last point immediately, consider using carpalx in conjunction with Das Keyboard.

You Must Be Joking

If all this sounds like an informercial, it is only because I am taking the subject of switching keyboard layouts with a modicum of skepticism and am allowing myself a certain license to parody my own process.

Only a small minority of typists use a non-standard layout. Here, by standard layout, I mean whatever layout is found in the closest internet cafe near you. In North America, QWERTY is the standard and very few people type on a different layout.

Realistically, we are very unlikely to switch layouts from whatever the local standard is (I argue here that the local standard should be changed). It's simply too hard to re-train — kudos to those who have done it!

I am under no delusion that anyone will read the contents of these pages and immediately run home to scrape off key markings on their standard layout and remap their keys to another layout, or some of the new layouts described here. Of course, if you were to do this I would recommend the partially optimized QWKRFY layout which achieves a significant typing effort reduction with only 5 keys swaps (for English text). I make some practical suggestions of how to go about doing this below.

International Layouts

Carpalx can work with any language. The input text can be a spoken language a programming language, or any set of characters that is typed.

The current limitation of carpalx in how alternate shift states for a key are handled. At the moment, each key has two shift states (two characters that it can represent). With the QWERTY these shift states represent lower/uppercase, digit/punctuation or punctuation/punctuation. The two shift states always travel together on a key. For example, ; and : are always assigned the same key, whatever its final location on the keyboard might be. Therefore, the location of shift state characters cannot be optimized independently.

Languages that have a lot of diacritical marks, extra characters are accessed using AltGr key on international keyboards. These special characters represent the 3rd, or higher, shift state on a key. In order for carpalx to meaningfully interpret and optimize shift states, further work on the code is required.

My own experience is limited to typing English. I would like to hear from international users who are interested in applying Carpalx to their languages. Should shift state characters be allowed to migrate independently of the characters that are accessed directly? What are your opinions about how the effort model should be adjusted to describe typing states (e.g. shift + altgr)?

Alternative Physical Keyboards

I often get asked whether Carpalx can be applied to non-standard keyboards, such as the Kinesis Advantage, Ergodox, Dactyl/Manuform, which are all split, or rectilinar keyboards like the TypeMatrix or Planck.

The answer is "yes". But there's a disclaimer (as usual).

When you run Carpalx, you first define the keyboard layout using a set of parameters. These parameters define the typing effort model and include: finger travel distance, finger and hand penalties and the effort to type 3-grams (which I call triads). As long as your layout can be captured by these parameters, then you're good to go.

The finger travel distance for each key is the easiest parameter to adjust—these values are objective. You take a ruler to the keyboard and enter the travel distance into a configuration file.

However, Carpalx assumes that the travel distance for a given key is fixed—for example, the distance travelled by the index finger to reach the U key is always the same. Carpalx is not compatible with physical keyboard layouts that requrie substantial movement of the wrist that would change this distance based on the typing context.

The row, finger (and, optionally, hand) penalties and the parameters that define stroke scores that penalize hand rolling motions, also need to be defined. These are subjective and experience with the keyboard is needed to create reasonable definitions. For the standard 101-key layout, these parameters are set based on my experience with typing on the keyboard. These are entirely subjective and different values will result in different optimizations.

If the keyboard is a prototype—and nobody yet has any experience on it—then you'd pick penalty scores parsimoniously and work from those.

Carpalx combines the finger travel distance, finger penalties and stroke efforts together to calculate the total effort. These three components are weighted so that they contribute equally for QWERTY – whose effort is 3.0 (i.e. each effort component contributes +1.0 to the effort).

For the best optimization (QGMLWB), the distance, penalty and stroke efforts are 0.38, 0.57 and 0.72. Compare this with QWERTY, for which all these values are 1.0. Thus, the finger travel distance component can be optimized to 38% of its original value, which is by far the component that contributes the most to the reduction in effort. The penalties can be optimized to 57% of their value (i.e. this is largely due to reducing the use of weaker fingers like the pinky). The stroke component is optimized to 72% of its original value – which is the smallest reduction of all the three components.

This means that although the stroke effort parameters are subjective and (very likely) over-parameterized, they actually have the least impact of all other parameters, at least in terms of the total effort of the optimization.

split layouts

Evaluating the effort of typing on split keyboards poses a challenge because there no way for Carpalx to quanify the additional "comfort" or reduced "effort" of having your wrists oriented in a particular way. Even on a regular keyboard, people have different wrist angles. For example, my hands sit with my knuckles at about a 30 degree angle, which would be pretty much the same as if they were on a split keyboard with knuckles parallel to the keys.

There is also no specific way to penalize a single key on a layout—this is something that would be compensated by the travel distance. For example, if a split layout has a key with a short travel distance, but nevertheless it's perceived as "more difficult to reach" than other keys with the same distance, you would increase its travel distance accordingly. The way this is handled on the standard layout is through finger, hand and row penalties, which do a good job in addressing such issues. For example, the travel distance for Z and U on QWERTY are the same, but Z is harder to reach. This is captured by penalties for the pinky and bottom row.

Typing Tools - Facilitating Migration to a New Layout

windows - portable keyboard layout (PKL)

If you are using Windows, I suggest you download and install Portable Keyboard Layout (PKL). This is a small, self-contained application that allows you to change keyboard layouts on the fly. Bring it with you on a USB key, for example, to have access to your layouts at all times.

Layouts for Programming

Many of you have asked whether I've tried to generate a keyboard layout specific to programming. While I haven't done any evaluation on code, it's very doable. However, keep a few things in mind.

First, the extent to which placement of symbols affects the overall score will depend on the proportion of those symbols in the code. If there's a lot of text, such as comments, or if the variable names are long, any penalties due to bad ergonomics of a poorly placed symbol character in the layout might get lost in the noise.

Second, character n-grams in programming are a lot less predictable. the typing effort model that carpalx implements uses two and three key combinations to assess typing difficulty. For language, this is useful because the frequency of n-grams is fixed for a language. However, with programming, n-grams that use symbol keys are unpredictable. A "]" may be as likely after an "a" as it is after a "z". This makes things like finger and hand alternation hard to optimize.

If you're looking for a layout for programming, take a look at the programmer Dvorak layout. Although I have not tried this layout, I'm instantly surprised by a couple of things—these may be naive initial impressions.

First, I'm surprised that the "{" and "}" are both on the left hand but "[" "(" open with left hand and close "]" and ")" with right. Depending on the language, some combinations like "[{" and "}]" are going to be common and having them symmetrically arranged is a good reinforcement.

Second, I'm surprised that the assignment "=" is in the middle of the keyboard, which is a long way for the index finger to stretch for such a common operator.

Finally, there's also the impact that the programming environment has on typing. A lot of environments auto complete strings, functions and auto close brackets and parentheses. Depending on your workflow, it may be that the closing "]", for example, is mostly auto closed and hardly ever typed.