Keyboard Notation Design Issues

By Xah Lee. Date: , ,

Issues about designing a keyboard notation.

Also, i used to use a <span class="kbd">…</span> tag to markup emacs key notation, but my use isn't consistent. For example, Ctrl+x find-file might be marked as Ctrl+x find-file or Ctrl+x find-file. The problem is actually quite thorny. It is about designing a consistent notation for keyboard shortcuts. Keep in mind that there are many types of key shortcuts. For example, single key such as {F1, ❖ Window}, or normal combination such as Ctrl+x , or a sequence of combination such as emacs's Ctrl+x Ctrl+f and Ctrl+x f, or Window's Alt+Space c, Alt t i (accessing menu by key, called “menu accelerator”). (A sequence of single keys is also common when you have sticky keys on, available in Windows, Mac, Linux.)

In general, it is not trivial to design a notation that is not ambiguous and covers all these different types of common key shortcuts practices. In general, you want a notation that can contain a sequence of key-press elements, and each key-press element can be a single key or key combination (such as Ctrl+x). Also, note that the key Ctrl+x does not simply mean pressing them together, but actually pressing and hold Ctrl first, and release it last.

Also, in designing such a notation, there's a consideration of space char in the notation. For example, Ctrl+c Ctrl+c does not mean you have to press a space in this sequence, rather, space is used as a separator.

Another issue to consider is the plus sign in it. For example, Ctrl+x does not actually involve pressing the “+” key. Rather, “+” is used to indicate combination. This can be a readability problem when you have Ctrl++(usually for zoom in). (in Microsoft's software, such case is simply written as Ctrl+ — a break of regularity. Apple's notation simply does not use any conjunction sign; it just place 2 keys together meaning for simultaneous pressed keys..)

Another issue is whether to consider a key as a key or as a character. For example, by convention, Ctrl+X means pressing the lower case x key, not capital X. This does introduce ambiguity. Most app's menu use a notation that explicitly include a Shift key. For example, in Firefox, “Show All History” shortcut is written as Ctrl+Shift+H, but for “Zoom In” it is written as Ctrl++ not Ctrl+Shift++ nor Ctrl+Shift+-. When you consider different keyboard layout, for example the QWERTZ layout used in Germany, the # key is not the shifted 3, this inconsistency about Shift key creates more ambiguity. [see Idiocy of International Keyboard Layouts]

Also, what does it mean when you have a sequence of char? For example, Ctrl+x does not mean pressing C, then t, then r, then l. However, in Meta+x dired, it does mean press each of the character in the word dired.

See also: Keyboard Shortcut Notations .

The way i want a human readable key notation with the degree of precision is close to creating a language for key macro applications. But if you look at those apps, their syntax is not human readable, hugely inconsistent, and basically most of them are just syntax soup with lots of special cases. See: