Banish Key Chords

By Xah Lee. Date: . Last updated: .

Key chords is the bane of keyboarding.

There are 3 types of keyboard shortcuts to invoke commands in software:

of these, in terms of efficiency and hand health (Repetitive Strain Injury), the single key is the best. Key sequence of single keys is second best. Key chord is the worst.

Key chord is the most hard on hand health, but is also conceptually the most convoluted.

i remember in around 1991, when i first learned about key chord on the Macintosh Classic. I remember thinking, it's strange. You have to hold ⌘ command first, then press the key c, then, release c, then, release ⌘ command. It must be in that specific order.

A more natural way is either key sequence, or real chords. Real chords, meaning, pressing several keys together but you don't have to worry about which to hold or release first. Stenograph machines are like that.

Whence Key Chord Came From?

Typewriter Hermes
mechanical typewriter, the mother and bane of all keyboard problems. 〔➤see Keyboard Hardware Design Flaws

Key chord probably started life on the mechanical typewriter, the ⇧ Shift key. The key pushes lever and shift gear, so it must be held down first, then you press other keys.

When computer keyboard came, sans levers and gears, but habit stuck, and engineers invented the “modifier” keys, with Bucky bits, to emulate the typewriter behavior.

Microsoft's Alt Key System

Now, thinking about this, i think Microsoft must be a genius, when they invented the key system on Windows around 1994, where Alt is used to invoke menu, and all command can be called by a sequence of key strokes. For example, pressing 【Alt e c】 does copy. If you press the sequence fast, menu won't show. If you press it slowly, menu shows. This is probably the best system given the PC keyboard. This system, lets you invoke any command, yet has menu counter-part, so it's easy to see a list of them and also grouped by category. (emacs supports this mechanism, and its key system is much more extensive than that.)

Now, this is real interesting. Who's the guy who designed the Microsoft Windows Alt key system?

What Should You Do with Key Chords?

BAN the banana out of the universe.

But, there isn't enough keys on keyboard. You only have 12 function keys, plus some others such as ↖ Home, . But there are 10 times more commands in software. 〔➤see Emacs Keybinding Efficiency: Page Up/Down and Pigeon Hole Principle〕 What to do?

For majority of commands, you should use a key sequence of single keys, instead. For example, 【F10 e c】. But Function keys are harder to reach. So, you could start with a easy key such as 【▤ Menu e c】. (you can make {Caps Lock, ❖ Window, ⌘ command} key as your start key.)

How many possible 3-keys sequence are there?

There are 26 letters in alphabet, plus 10 digits. So you have 36 key choices for a key. Let's add punctuations . , ' ; to make it 40. If each of your command has 3 keys in a key sequence, counting the lead key, then you have 1 × 40 × 40 = 1600 possible keys for commands. Enough!

Now, suppose one of your key sequence is 【Caps Lock 2 1】 on QWERTY layout. Now, the “21” is rather hard to type, involving little finger and pinky reaching the number row. So, if we consider also typing efficiency, how many 3-keys sequence do we have?

Let say each hand can only have 12 key choices. (For example, for left hand, the available keys are just qwer asdf zxcv )

Now, two hands, so you have 24 choices per key. So, we have 1 × 24 × 24 = 576 choices. Enough.

Note: out of emacs default 1 thousand keys 〔➤see List of Emacs Default Keybinding〕, the number of commands that are practically used is under 300. For vast majority of emacs users, if you log their commands that are executed by a keybinding, within 1 month, i think the figure is less than 200, with perhaps 70% of them only called once.

Still, some commands are not suitable for key sequence. For example, moving cursor by word. You want to be able to hold down a key and have the cursor keep moving. You can't do that with key sequences, because you need to release the key and press again to invoke the command again. Answer: use single-press key. Retort: But F1 F2 … keys are far away and all other single-press key such as {↖ Home, ↘ End, , , , , …} keys are already used. Answer: key chord then.

Principles of Efficient Use of Chord Keys

more detail at Keyboard Shortcut Design: Repeatable vs Non-Repeatable Commands and Keys

If you survey commands in software applications, for example:

Vast majority of commands are the non-repeating type. The repeating type are less than 2.5% of commands. Using 【Ctrl+‹letter/digit›】 key give you about 36 spots. Adding 【Alt+‹letter/digit›】, you have 72 spots. And that's more than enough for repeating commands. In practice, i estimate a programer uses less than 25 repeating commands.

Defining Key Sequence in Linux

The Linux LXDE/Openbox windows manager supports key sequences out of the box. The keybinding can also be app specific.

For other linux desktop/window systems, it's still possible, but you have to take days do learn how.

Defining Key Sequence in Emacs

Emacs also supports key sequences out of the box. For how, see: Emacs: Define Key Sequence

What About Using Sticky Keys to Turn Key Chord into Key Sequence?

In {Windows, Mac, Linux}, there's a sticky key feature. When you need to press a key chord, such as 【Ctrl+x】, you can just type them separately 【Ctrl x】. That's what the sticky key feature does.

linux xfce sticky key
Linux xfce sticky key

Eventually, i stopped using sticky keys, because, under Linux, it's not 100% reliable. Sometimes you get a stuck shift.

Some emacs people really love sticky keys. They are, at least:

For Emacs Users

For emacs, you have few choices: