Philosophical Multicore

Sometimes controversial, sometimes fallacious, sometimes thought-provoking, and always fun.

Should a keyboard layout optimize for hand alternation or for rolls?

Posted by Michael Dickens on January 9, 2010

Thanks to a really nice typing program called Amphetype, I have recently been able to collect some good data on my typing habits. I compiled some data and did a rudimentary analysis of my fastest and my slowest trigraphs. I analyzed my 180 fastest trigraphs and my 156 slowest trigraphs, classifying each one in one of three categories: fully alternating, alternating and rolling, or fully rolling. If it is fully alternating, then each key is typed on the opposite hand from the previous key. If it is fully rolling, then each key is typed on the same hand. And if the trigraph is alternating and rolling, then there are two consecutive keys on one hand, and the third key is on the other hand.

Among the fastest trigraphs, 10% were fully alternating, 75% were alternating and rolling, and 15% were fully rolling.

Among the slowest trigraphs, 21% were fully alternating, 38% were alternating and rolling, and 40% were fully rolling.

So what does this mean? First, let us remember that there are twice as many ways for a trigraph to be alternating and rolling as to be fully alternating or fully rolling. So given a random sample, we would expect a distribution of 25%, 50%, and 25%. The data I have isn’t totally accurate, but it should be pretty close. What’s clear from this data is that fully alternating keys and fully rolling are rarely very fast. Not only that, but you have to count down to the 13th fastest trigraph before you find one that isn’t alternating and rolling. So alternating and rolling is clearly the fastest possibility.

Now let’s look at the slowest trigraphs. These are more evenly distributed. But notice that there are not as many alternating and rolling trigraphs as you’d expect, and there are a lot more trigraphs that are fully rolling. So there are a lot of very slow trigraphs that are fully rolling.

As simple as this data may be, it still gives us some useful information. To optimize our keyboard, we should try to maximize combos where you type two keys on one hand and then switch to the other hand. Getting a computer to do this in practice, though, is tricky. My program is designed to use digraphs; it can use trigraphs with a small modification, but using trigraphs is orders of magnitude slower. We still may be willing to sacrifice speed for accuracy; but is there any way to still maximize our goal of two-keys-at-a-time using digraphs and not trigraphs? I certainly don’t see any way.


5 Responses to “Should a keyboard layout optimize for hand alternation or for rolls?”

  1. xuinkrbin. said

    “My program is designed to use digraphs; it can use trigraphs with a small modification, but using trigraphs is orders of magnitude slower.”

    I am curious what that “small modification” would be. I’d like to make that adjustment to the copy of the code I have here and try some possible layouts.


    • I’m currently working on a version that uses trigraphs. Why do you want it to use trigraphs instead of digraphs?

      If you really want to change the code now, here’s the simplest way to do it. This isn’t the fastest way, but it’ll get the job done.

      First, download my program from this page. Then, you’ll need to make a modification to how the scoring works. You’ll have to decide how the scoring will work. The simplest way is to simply call scoreDigraphs() twice, once for the first and second elements of the trigraph and once for the second and third elements. That won’t do anything extra, though. If you want, you can add new scoring functions. If you understand how C programs work, it’s fairly simple. A keyboard is stored in an array of 30 characters, with keyboard[0] = Q, keyboard[1] = W, keyboard[2] = E, etc., at least for QWERTY; other layouts will have other positionings. There are also some useful built-in functions such as: loc(keyboard, c) which returns the location of character c on the given keyboard; HAND(loc) which returns either LEFT or RIGHT depending on what hand the number x is on; and finger(loc) which returns PINKY, RING, MIDDLE or INDEX. Most scoring functions can be easily built off of these (you can just look at the code in fitness.c to get an idea of how they work).

      If you need any help, let me know.

      • xuinkrbin. said

        Thanks. I tend to think in groups of 3 and typing is no exception. So, I’m looking to see if I can come up with a layout which sits as well with the thoughts I have as well as the fingers I use and the order in which I use them.

  2. phynnboi said

    I think if you optimize for both some kind of rolling and for hand alternation, the phenomenon you’re after should largely fall out automatically. That’s what my program does.

    • In the previous version of my program, when I was still using trigraphs, I tried to optimize rolls and also minimize certain kinds of typing on one hand — essentially, anything that wasn’t a roll. I gave it up on my new program. However, I’m planning a different type of scoring algorithm that will be more objective.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: