Alternative Keyboard Layouts

Introduction

There's lots of stuff on the web about which is the best keyboard layout. I have read some of it and I have been using the "Dvorak" keyboard (slightly modified) for years now. With this web page, I want not so much to join the argument or give my theory on why our keyboards all say "QWERTY". Instead, I want to examine these questions:
  1. What makes a particular layout good?
  2. How can I make my computer search for a good layout?
The first question is impossible for me to answer completely, but the second isn't.
I was inspired by my favorable experience with the Dvorak keyboard and by the work of Michael Capewell and Håkon Hallingstad.

Questions

What makes a particular layout good?

  • Minimize finger movement
  • Minimize spreading of fingers
  • Minimize uncomfortable wrist positions
  • Maximize the use of comfortable sequences of keystrokes, e.g. df and kl on the QWERTY keyboard
  • Minimize combinations that are error prone, and the converse

Search Program

This program must:
  • Have a data structure representing a keyboard layout
  • Give a score or fitness value to a given keyboard layout
  • Search among all possible layouts to find the one with the best score

Keyboard Data Structure

My current scheme represents a keyboard layout as a string of 37 characters. This assumes that the number keys should stay where they are. Shifted states will, for now, travel with the unshifted key (shift+[ will still be {, wherever [ ends up).
The QWERTY keyboard is represented by the string:
`-=qwertyuiop[]\asdfghjkl;'zxcvbnm,./

Scoring Method

The main idea is to make a layout "type" a sample text and decide how well it did.
Favorable patterns make the score better, bad patterns make it worse. Especially good or bad patterns make the score especially better or worse.
More . . .

Search Method

  1. Start out with a few layouts.
  2. Score the layouts.
  3. Replace the worst-scoring half with slightly-changed versions of the better half.
  4. Score the replacements.
  5. Repeat the previous two steps until the end of time or so.
I have tried a variation that uses a genetic algorithm to search. Its success is limited, not least by my limited understanding of genetic algorithms. I gave up pretty soon after I managed to make a working GA. It was relatively slow and got stuck a lot earlier than my hill-climbing search. It seemed like it was going to take a great deal of work. Maybe I'll fix this later, but that would require learning a lot more about GAs, which is doubtful for me now.

Source Code

Here is a zip file of my program written in Common Lisp. I also have a version in Emacs Lisp and C++, but I haven't managed to pack these up yet.

My Current Favorite

Here's the highest-scoring of the layouts my search program has discovered, with a few modifications by hand.

image of search program's best candidate

This layout is represented as:
`[]jldpbquof/-=\rsthmgnaei,wxvck.yz';
I constrained the keys xvc to roughly the same positions that they occupy on the QWERTY keyboard.
I also constrained the keys `[] to either their QWERTY or Dvorak positions.

My Current Least Favorite

By the way, for anyone who feels like QWERTY is really dreadful, I had my program look for the worst possible layout. Here's one attempt:

image of search program's worst candidate


Last changed: $Date: 2008-09-27 16:56:24 $
Hosted by www.Geocities.ws

1