Dead key


A dead key is a special kind of a modifier key on a mechanical typewriter, or computer keyboard, that is typically used to attach a specific diacritic to a base letter. The dead key does not generate a character by itself, but modifies the character generated by the key struck immediately after. Thus, a dedicated key is not needed for each possible combination of a diacritic and a letter, but rather only one dead key for each diacritic is needed, in addition to the normal base letter keys.
For example, if a keyboard has a dead key for the grave accent, the French character à can be generated by first pressing and then, whereas è can be generated by first pressing and then.
Another example is the Spanish letter Ñ, which can be generated via and, hence Ñ.
Usually, the diacritic itself can be generated as an isolated character by pressing the dead key followed by space; so a plain grave accent can be typed by pressing and then.

Usage

A dead key is different from a typical modifier key in that rather than being pressed and held while another key is struck, the dead key is pressed and released before striking the key to be modified. In some computer systems, there is no indication to the user that a dead key has been struck so the key appears dead, but in some text-entry systems, the diacritic is displayed, along with an indication that the system is waiting for another keystroke to complete the typing sequence.
On a typewriter, the character modifier functionality is accomplished mechanically, by striking the diacritical mark without advancing the carriage. With most mechanical typewriters, the key on the keyboard caused a small bar of metal to rise; the letter desired was on the end of the bar. In addition to striking the paper through the ribbon, causing ink to be deposited on the paper, the bar would prevent the platen-paper carriage assembly from advancing. Thus, the following letter will strike the same spot on the paper. A typewriter is made in such a way that one could place an acute accent on a q, for example.
Computers, however, work differently. The dead key temporarily changes the mapping of the keyboard for the next keystroke, which activates a special keyboard mode rather than actually generating a modifier character. Instead of the normal letter, a precomposed variant, with the appropriate diacritic, is generated. Each combination of a diacritic and a base letter must be specified in the character set and must be supported by the font in use.
There is no precomposed character to combine the acute accent with the letter q, striking and then is likely to result in ´q, with the accent and letter as separate characters. However, in some systems, the invalid typing sequence may be discarded.

Chained dead keys

encoded over one hundred precomposed characters with two diacritics, for use in Latin script for Vietnamese and a number of other languages. For convenience, they are generated on most keyboards supporting them, by pressing the two corresponding deadkeys in any order, followed by the letter key. Therefore, these dead keys are chained, which means that the second keystroke does not trigger any insertion, the system being still awaiting another key press.
This chained dead key behavior is toggled by the dead key flag, which is the fourth argument of the DEADTRANS function. If this flag is set to its default value zero, the composed character is inserted; if it is set to one, the composed character code is handled as another diacritic code like those due to dead key presses, and occurs typically as a second argument in other deadlist entries.
Chaining dead keys allows for compose key emulation by simply using the dead key feature. This may be performed either with proprietary keyboard editing software, or with driver development kits.

Dead keys on various keyboard layouts

A key may function as a dead key by default, and many non-English keyboard layouts in particular have dead keys directly on the keyboard. The basic US keyboard does not have any dead keys, but the US-International keyboard layout, available on Windows and the X Window System, places some dead keys directly on similar-looking punctuation marks. Keyboards sold in most of the rest of the world have an AltGr key, which gives the ability to modify some letters directly and turns others into dead keys. Old computer systems, such as the MSX, often had a special key labeled dead key, which in combination with the Ctrl and Shift keys could be used to add some of the diacritics commonly needed in the Western European languages to vowels that were typed subsequently.
In the absence of a default dead key, even a normal printing key can temporarily be altered to function as a dead key by simultaneously holding down another modifier key. In Microsoft Word, using the Control key with a key that usually resembles the diacritic acts as a dead key: On the Macintosh, many keyboard layouts employ dead keys. For example, when are first pressed simultaneously and then followed by, the result is á. On a Macintosh, pressing one of these Option-key combinations creates the accent and highlights it, then the final character appears when the key for the base character is pressed.
However, some accented Latin letters less common in the major Western European languages, such as ŵ or š, cannot be typed with the "US" layout. For users with US keyboards, access to many more diacritics is provided by the "US International" keyboard layout. Users with UK keyboards have a similar option with UK extended layout; many other national settings are available.
In AmigaOS, dead keys are generated by pressing in combination with , , , or .