Short Survey of Keyboard Shortcut Notations

, , …,

This article details some issues about designing a notation that represent key presses, as often displayed in software's graphical user interface menus.

Here's some sample shortcuts notations used for various keys, from Microsoft Windows. These are collected from: {Microsoft's Internet Explorer (Version 8.0), Windows Mail (Version 6.0)}.

Key Notations from Microsoft Software
NotationAssociated Menu Command
Ctrl+NNew Window in IE
Ctrl+Shift+HHistory in IE
Alt+F4Close
Alt+Left ArrowBack in IE
EscStop in IE
F5Refresh in IE
Alt+HomeHome Page in IE
Alt+EnterProperties in Windows Mail

(missing examples of using the Tab key, and Page up/down key, Backspace and Delete keys.)

[about choosing a keyboard shortcut notation for a new emacs distribution ErgoEmacs] I think Microsoft's notation is good enough, though i do have a little personal gripes about keyboard shortcut notations.

With keys involving shift key, in my mind i always thought it should be 【Ctrl+n】 and 【Ctrl+⇧ Shift+n】, not with capitalized letters 【Ctrl+N】 and 【Ctrl+⇧ Shift+N】.

The difference between my model and the Windows model is that, in my model, the shortcut notation are interpreted as typed text. That is, users TYPE characters with modifiers. Emacs uses this interpretation for its keyboard shortcuts notation too. In the Windows notation, keys are more thought of as buttons on the keyboard hardware. This model is actually more sensible.

In the docs i wrote i always used my model, but never really seriously decided if it is better.

IE9 menu key notation
Windows key shortcut notation, shown in Internet Explorer 9's menu. Note the break of consistency in Zoom In/Out keys.

Notational Problems with Shifted Keys

Both models do have some problems. In my model, the notation to represent the keypress combination of Ctrl and ⇧ Shift and 1 is 【Ctrl+@】. The problem here is that the notation clearly shows 2 button press, yet in fact you also need to press the Shift key. In Microsoft's notation 【Ctrl+⇧ Shift+@】, the problem is that there's really no key as 【⇧ Shift+@】. There's just 【⇧ Shift+1】. The 【⇧ Shift+@】 could actually mean something else in different International Keyboard Layouts.

Note that you can also write it as 【Ctrl+⇧ Shift+1】. More than one notation for the same key press is not good. But also, it introduces another notation .

For example, the somewhat standard key combo to increase font size (aka zoom in) is pressing Ctrl and ⇧ Shift and +. In Firefox on Windows, it is shown in menu as 【Ctrl++】. Note that it made a choice to skip showing the “Shift” key. Normally, it really should be 【Ctrl+⇧ Shift+=】. The reason that it made the choice of using the version not showing the Shift key, is because that way it is more obvious to see that “+” is zoom in and “-” is zoom out. That is, consider 【Ctrl++】 and 【Ctrl+-】, versus, 【Ctrl+⇧ Shift+=】 and 【Ctrl+-】. (Just noticed, that in Internet Explorer, it actually uses this notation 【Ctrl +】. This shows that the Microsoft UI designers are willing to sacrifice consistency for ease of understanding.)

This multiple representation problem occurs because of the fact that some keys are used for more than one glyph with the Shift down (For example, “1” and “!”, “2” and “@”, “3” and “#” etc.). The end result is that there is no one-to-one correspondence with a key combination and its notation.

This problem gets worse with different keyboard layouts, because not all layouts have the same Shifted symbols. For example, i looked at the Spanish Spain layout, according to Wikipedia article on Keyboard layout, a key combination of Ctrl and the ampersand symbol, would be: 【Ctrl+⇧ Shift+6】 and 【Ctrl+&】. But in US keyboard and layout, it would be 【Ctrl+⇧ Shift+7】 and 【Ctrl+&】. This means, when given a shortcut such as 【Ctrl+‹symbol›】, it does not always have a unique meaning, unless the layout is also specified.

Key Notation as Typed Characters vs Pressing Buttons

There's a precision advantage of notations as typing text instead of pressing buttons on keyboard. Because, if we treat the notation as chars to type, then 【Ctrl+&】 would be the only notation for this particular shortcut, so there's no 【Ctrl+⇧ Shift+7】 or 【Ctrl+⇧ Shift+6】 alternatives that are dependent on keyboard layout. This is what emacs do. Emacs is this way because it is evolved from 1980s, where there is not much notion of keyboard shortcuts, but more about programing and character stream entered by user.

The advantage of notation as indicating what buttons to press, is that it's more clear and better fits the purpose of communication. Because, it's more natural to think of keyboard shortcuts as pressing a combination of buttons than typing some characters with modifiers.

For example, consider what happens when user sees 【Ctrl+*】 vs 【Ctrl+⇧ Shift+8】. The one with the Shift key is more clear, because it explicitly indicates that there are 3 keys involved. For the notation without the Shift key, it is odd because user actually need to press the Shift key yet it is not indicated in the notation.

Apple's Key Notation

Apple's OS X's key notation does not use the plus sign. For example, in Firefox for the Mac, to zoom in, the notation on the menu is shown as: “⌘+”, which means holding down the Command key and press “+”. The Apple model is arguably more elegant, it but too, has problems.

Apple Mac OS X keyboard shortcut notation 2
Shortcut Notation used in Mac OS X, from Safari.
Apple keyboard shortcut symbols
Key symbols used in Mac OS X menu, as of 2009.

Here's the Apple's key symbols in Unicode.

SymbolMeaningUnicode name
Command keyPLACE OF INTEREST SIGN
Option/AltOPTION KEY
^Control keyCIRCUMFLEX ACCENT
Shift keyUPWARD WHITE ARROW
EnterUP ARROWHEAD BETWEEN TWO HORIZONTAL BARS
ReturnLEFTWARDS ARROW WITH HOOK
Up ArrowUPWARDS ARROW
Down ArrowDOWNWARDS ARROW
Right ArrowRIGHTWARDS ARROW
Left ArrowLEFTWARDS ARROW
Page UpUPWARDS ARROW WITH DOUBLE STROKE
Page DownDOWNWARDS ARROW WITH DOUBLE STROKE
HomeNORTH WEST ARROW
EndSOUTH EAST ARROW
DeleteERASE TO THE LEFT
Forward DeleteERASE TO THE RIGHT
EscapeBROKEN CIRCLE WITH NORTHWEST ARROW

In Apple's notation, symbols are place in sequence one after another. ⁖ 【⌥⇧⌘V】.

In the Apple's model, adjacency implies pressing keys together. In order to use the Apple model, it is necessary to introduce symbols for modifier keys. If you don't use special glyphs, then 【Ctrl+N】 would become 【CtrlN】. (Alternative is to render keys with boxes, example: 【Ctrl N】)

Apple Notation Problems

Note that Apple's notation does have some limitation too.

Problem with Key Sequences

One problem is with representing shortcuts that are key sequences. For example, in Windows, you can press Alt, release, then press f, release, then press o, to invoke the menu item for Open. This is a key sequence. Also, you can press 【Alt+space】, then c, to close the window. In this sequence, it also involves a combination (pressing multiple keys together at the same time). Emacs use both of these type of key sequences, and extensively with the combo sequence. (example: 【Ctrl+x k】, 【Ctrl+x Ctrl+c】, 【Esc Esc Esc】)

Apple's OS X does not use any key sequences as shortcuts (unless you turn on sticky keys for those physically disabled). For Apple's notation to adopt to key sequences, it needs to introduce a separator. For example, 【⌘ Cmd+h i】 would be written as 【⌘H,I】. Here, we used a comma as separator.

Note that the separator can be a issue itself. For example, if we use a comma, it is ambiguous because it could mean 【⌘ Cmd+h , i】. But if we use space 【⌘H I】, then it leaves the question of how to represent the space key. (⁖ one of emac's shortcut is 【Ctrl+Space】.)

Some references:

Notation as Human Interface vs Programing Language Syntax

A related issue is key syntax for defining key presses. This issue is entirely separate from Keyboard Shortcut notation. Key syntax is designed to communicate to machines. It needs to be completely precise. Key notation is used to communicate to humans.

There is no standard, of a syntax/language to represent key presses as needed in software that needs to deal with keyboard shortcuts. Each Operating system, or key macro, key mapping, key layout software, invents its own syntax. Here are some examples of the different syntax used by different systems:

It is conceivable to have a key syntax that is as precise as a computer language yet also readable for human communication. The closest might be emacs's key macro notation, yet it has many problems due to historical baggage. 〔➤ Emacs's Key Notations Explained (/r, ^M, C-m, RET, <return>, M-, meta)

blog comments powered by Disqus