Compose key

{{Short description|Computer key to initiate glyph merger}}

File:XFCE4 Compose key selection.png keyboard layout settings window, featuring a compose-key option]]

A compose key (sometimes called multi key) is a key on a computer keyboard that indicates that the following (usually 2 or more) keystrokes trigger the insertion of an alternate character, typically a precomposed character or a symbol.{{cite web |url=http://fsymbols.com/keyboard/linux/compose/ |title=Linux Keyboard Text Symbols: Compose-Key Shortcuts |website=FSymbols |date=2013-07-24 |access-date=2015-07-07}}

For instance, typing {{key press|Compose}} followed by {{key press|~}} and then {{key press|n}} will insert ñ.

Compose keys are most popular on Linux and other systems using the X Window System, but software exists to implement them on Windows and macOS.

History

The Compose Character key{{cite web |url=http://www.wickensonline.co.uk/public-gallery/LK201/p1060628.html |title=p1060628 |website=WickensOnline |date=2007 |access-date=2015-07-07 |archive-url=https://web.archive.org/web/20150413081423/http://www.wickensonline.co.uk/public-gallery/LK201/p1060628.html |archive-date=2015-04-13 |url-status=dead }}{{cite web |url=http://www.netbsd.org/docs/Hardware/Machines/DEC/LK201_large_keycodes.jpg |format=JPEG |title=LK201_large_keycodes.jpg |website=The NetBSD Project |access-date=2015-07-09}} was introduced by engineers at Digital Equipment Corporation (DEC) on the LK201 keyboard, available since 1983 with the VT220 terminal.{{cite web |url=http://windows.appstorm.net/roundups/utilities-roundups/add-a-virtual-compose-key-to-your-pc/ |title=Add a Virtual Compose Key to Your PC |website=Windows.Appstorm |access-date=2015-07-07 |archive-date=2020-11-06 |archive-url=https://web.archive.org/web/20201106074437/http://windows.appstorm.net/roundups/utilities-roundups/add-a-virtual-compose-key-to-your-pc/ |url-status=dead }} The keyboard included an LED indicating that a Compose sequence is on-going.{{cite web |url=http://www.wickensonline.co.uk/public-gallery/LK201/p1060631.html |title=p1060631 |website=WickensOnline |date=2007 |access-date=2015-07-07 |archive-url=https://web.archive.org/web/20150413081428/http://www.wickensonline.co.uk/public-gallery/LK201/p1060631.html |archive-date=2015-04-13 |url-status=dead }} While the LK201 introduced the group of command keys between the alphanumerical block and the numerical keypad, and the "inverted T" arrangement of arrow keys, which have become standard,{{cite web |url=http://www.eldacur.com/~brons/NerdCorner/InverseT-History.html |title=Inverse-T History |last=Burrows |first=Jim |date=2009-09-21 |website=Nerd Corner |access-date=2015-07-09}} the compose key by contrast did not become a standard.

In 1987, Sun Microsystems released the Sun4, the first dedicated Unix workstation that had a compose key. On the keyboards of Sun Type 5 and 6 workstations, the Compose LED is placed in the keycap (see picture below).

ISO/IEC 9995-7 designed a graphical symbol for this key, in ISO/IEC 9995-7 as symbol 15 "Compose Character", and in ISO 7000 "Graphical symbols for use on equipment" as symbol ISO-7000-2021. This symbol is encoded in Unicode as {{unichar|2384|COMPOSITION SYMBOL}}.

Because Microsoft Windows and macOS do not support a compose key by default, the key does not exist on most keyboards designed for modern PC hardware. When software supports compose key behaviour, some other key is used. Common examples are the right-hand Windows key, the {{key press|AltGr}} key, or one of the {{key press|Ctrl}} keys.{{cite web|url=http://earthwithsun.com/questions/64178/compose-key-on-windows|title=Compose Key on Windows|website=Earthwithsun.com|archive-url=https://web.archive.org/web/20160303172349/http://earthwithsun.com/questions/64178/compose-key-on-windows|archive-date=2016-03-03|access-date=2015-07-07}} There is no keyboard LED or other physical indicator that a compose sequence is ongoing, though the OS may show some icon (such as the "Compose Character" symbol, below) on the user's text input field.

{{Gallery

| File:Compose key on LK201 keyboard.jpg | The compose key on a DEC LK201 keyboard is the leftmost key on the bottom row.

| File:Compose key on Sun Type 5c keyboard.jpg | The compose key and compose LED on Sun Type 5 and 5c keyboards is the second-rightmost key on the bottom row.

| File:ISO 7000 - Ref-No 2021.svg | ISO keyboard symbol for "Compose Character"

}}

Compose sequences

If the Compose key is not also a modifier key, then key rollover means the compose key does not have to be released before the subsequent keystrokes. This makes it possible for experienced typists to enter composed characters rapidly.

Earlier versions of compose sequences followed handwriting and the overstrike technique by putting the letter first and diacritics second. For example {{key press|Compose|n|~|chain=}} produced the character ñ. This order is still in use,{{cite web |url=http://lolengine.net/blog/2012/06/17/compose-key-on-os-x |title=Setting up a Real Compose Key on Mac OS X |website=Lol Engine |date=2012-06-18 |access-date=2015-07-07 |archive-date=2020-06-22 |archive-url=https://web.archive.org/web/20200622230501/http://lolengine.net/blog/2012/06/17/compose-key-on-os-x |url-status=dead }} however the inverse order known from accent-mark dead keys present on the last typewriters is used today: {{key press|Compose|~|n|chain=}} for ñ.{{cite web |url=http://soft.zoneo.net/Linux/compose_key.php |title=Enter european accented characters on an american keyboard |website=ZoneO Software |date=June 2006 |access-date=2015-07-07 |archive-url=https://web.archive.org/web/20150418003212/http://soft.zoneo.net/Linux/compose_key.php |archive-date=2015-04-18 |url-status=dead }} This allows multiple diacritics, for instance typing {{key press|Compose|'|^|a|chain=}} for .

Non-accented characters are generally constructed from letters that when overtyped or sequenced would produce something like the character. For instance {{key press|Compose|o|c|chain=}} will produce the copyright symbol ©, and {{key press|Compose|A|E|chain=}} will produce Æ.

There is no intrinsic limit on sequence length, which should respect both the rules of mnemonics and ergonomics, and feasibility within a comprehensive compose tree. For example, {{unichar|278C|DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT THREE}} might be inserted by {{key press|Compose|@|%|$|3|chain=}}, where {{key press|@}} indicates circled characters,{{key press|@}} is suggested for circled characters, rather than {{key press|o}}, so that {{key press|Compose|@|c|chain=}} can yield {{unichar|24D2|circled latin small letter c}}, while {{key press|Compose|o|c|chain=}} yields {{unichar|00A9|copyright sign}}. {{key press|%}} indicates inverse, {{key press|$}} indicates sans-serif, and {{key press|3}} indicates the final character.

Compared to other input methods

File:Keyboard layout Czech.svg QWERTZ keyboard layout. Characters achieved using AltGr are shown in blue, dead keys are shown in red]]

The primary advantage of a compose key is that the sequence used to select the character can be made up of any letters, numbers, or symbols available on the keyboard. This allows the sequence to be more mnemonic, so it is easier to remember, possible to guess at if unknown, and can support far greater numbers of characters.

The primary disadvantage is that compose sequences always require at least one more keystroke. Inconvenient placement of the compose key can also slow typing.

The most common method used to enter characters not printed on the keys is a modifier key such as AltGr. This method suffers from the limitation that AltGr adds just two more (shifted and unshifted) associations for each key. The additional characters made available are typically customized to the local market and thus meet the needs of most users, most of the time. The default UK/Ireland layout, for example, provides (via AltGr+aeiou) the letters á é í ó ú that are needed for Irish Gaelic but consequently not the letters à è ì ò ù needed for Scottish Gaelic.

A dead key treats the first character in any sequence as a modifier for the next key[s]: when pressed, the key appears to have no effect until the next key is pressed. (Most systems try to make the choice of dead key a logical part of the character selection; this makes sense for accent marks and the concept is extended to other symbols). For example, the grave ("backtick") key ({{char|`}}) is often a dead key: to achieve {{char|à}}, the sequence {{keypress|`|a}} is used. Compound sequences are possible: for example to add a two dots (diacritic), the {{keypress|"}} seems an obvious candidate but clearly this heavily used key cannot be repurposed as a dead key. The solution is to modify it using AltGr, thus {{keypress|AltGr|2}}{{nbsp}}{{keypress|a}} delivers {{char|ä}}.{{efn|{{keypress|AltGr|2}} rather than {{keypress|AltGr|"}} because 2 and " share the same key in the UK/Ireland layout and {{keypress|AltGr|shift|2}} is already assigned to {{char|½}} ({{frac|1|2}}).}} Other combinations are rather less obvious than their compose-key counterparts: for example compare {{keypress|Compose|,|s}} with {{keypress|AltGr|{{=}}}}{{nbsp}}{{keypress|s}} for {{char|ş}} (ChromeOS with UK extended mapping).

Alt codes or Unicode numerical input could almost be considered a compose key, but use unintuitive numbers, instead of mnemonics, as the selector.

Modern GUI character choosers often require a search function that is not much different than the compose sequences to locate a character quickly.

Software support

=X Window System=

X header files call the Compose Key the "Multi_key". On Xorg the default Compose Key is {{key press|Shift}}+{{key press|AltGr}},{{cite web|title=Compose Key|url=https://help.ubuntu.com/community/ComposeKey|publisher=Ubuntu|access-date=2012-07-10}} (while pressing {{key press|AltGr}} before {{key press|Shift}} is the "fourth keyboard level modifier", a different key). On Gentoo Linux the Compose Key is disabled by default.{{Cite web |title=Compose key - Gentoo wiki |url=https://wiki.gentoo.org/wiki/Compose_key |access-date=2024-04-27 |website=wiki.gentoo.org}} As this is rather inconvenient (especially for keyboards without an {{key press|AltGr}}), it is common to select a keyboard layout where another key such as the right-hand {{key press|Ctrl}} or {{Key press|Win}} is mapped to the compose key. This option is normally available in the settings of the desktop environment. The X keyboard driver does not allow the key used for Compose to also function as a modifier.{{Citation needed|date = July 2015}} On modern systems a vast number of compose sequences are supported.{{cite web |url=http://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre |title=UTF-8 (Unicode) compose sequence |last=Monniaux |first=David |access-date=2015-07-15}}

=Windows=

On Microsoft Windows, a few programs such as PuTTY provide compose-key support.{{citation-needed|date=May 2023}} To emulate the compose key for all software, keyboard shortcut utilities are often involved. There are also a number of open-source utilities (such as WinCompose,[https://github.com/SamHocevar/wincompose Compose Key for Windows] – GitHub. AllChars,[http://sourceforge.net/projects/allchars/ AllChars] – SourceForge.net. Compose-Keys,[https://github.com/MrBertie/compose-keys Compose Keys] – GitHub. or Compose[https://github.com/p3lim/Compose Compose] – GitHub.). Installable keyboard layouts (such as KbdEdit[http://www.kbdedit.com/manual/ex17_compose_key_chained_dead.html KbdEdit – Emulating Compose key using chained dead keys].) are available that contain a compose key assigned to one of the keys like {{key press|Ctrl}} or {{key press|AltGr}}. They work by using the dead-key chaining feature that is more commonly used to input letters with multiple diacritics. Such keyboard layouts can also be programmed directly in C (the language Windows drivers are written in), compiled using the free-of-charge Windows Driver Kit,[https://www.microsoft.com/en-us/download/details.aspx?id=11800 Windows Driver Kit Version 7.1.0] – Official Microsoft Download Center. and packaged using the free-of-charge Microsoft Keyboard Layout Creator 1.4,[https://www.microsoft.com/en-us/download/details.aspx?id=102134 Microsoft Keyboard Layout Creator 1.4] – Official Microsoft Download Center. compatible up to the latest versions of the OS.

=macOS=

Although the Cocoa text input system allows entry of many alternate and accented characters natively in macOS,{{cite web |url=http://uscustom.sourceforge.net/ |title=U.S. custom Keyboard Layout |last=Wust |first=J. 'Mach' |website=SourceForge |date=2015-06-29 |access-date=2015-07-07}} a true compose-key solution is not built in. At least one has been implemented using the Karabiner utility, which works with all applications, as does the use of certain keyboard layouts (e.g. "ABC – Extended") where Compose is implemented using the dead key chaining feature.

=ChromeOS=

Although ChromeOS is supplied with a larger repertoire of glyphs than most competitors, the chords needed to achieve them are not always as obvious as the Compose concept provides. Google has made available an add-on (ComposeKey) to compete in this market.{{cite web|url= https://github.com/google/extra-keyboards-for-chrome-os/tree/master/composekey | title= extra-keyboards-for-chrome-os/composekey/ | website=github.com | access-date=28 January 2020}}{{cite web | url=https://chrome.google.com/webstore/detail/composekey/iijdllfdmhbmlmnbcohgbfagfibpbgba |title = ComposeKey| website=Chrome Store | access-date=28 January 2020}}

=DOS=

Under DOS, compose key support depended on the running application, or on a loadable keyboard driver. For example, Lotus 1-2-3 used {{keypress|Alt|F1}} as compose key to allow easier input of many special characters of the Lotus International Character Set (LICS){{cite book |title=HP 95LX User's Guide |publisher=Hewlett-Packard Company, Corvallis Division |location=Corvallis, OR, USA |edition=2 |chapter=Appendix F |date=June 1991 |orig-year=March 1991 |id=F0001-90003 |url=http://www.retroisle.com/others/hp95lx/OriginalDocs/95LX_UsersGuide_F1000-90001_826pages_Jun91.pdf |access-date=2016-11-27 |url-status=live |archive-url=https://web.archive.org/web/20161128202642/http://www.retroisle.com/others/hp95lx/OriginalDocs/95LX_UsersGuide_F1000-90001_826pages_Jun91.pdf |archive-date=2016-11-28}} and Lotus Multi-Byte Character Set (LMBCS).

Common compose combinations

The table shown below shows some of the default compositions for the X.Org server. For modern systems which support Unicode, the table below is far from complete.

style="vertical-align: top;"

|

{| class="wikitable nounderlines"

!type!!for

| {{key press|Compose|{{tt|'}}|{{tt|a}}|chain=}}á
| {{key press|Compose|{{tt|"}}|{{tt|a}}|chain=}}ä
| {{key press|Compose|{{tt|`}}|{{tt|a}}|chain=}}à
| {{key press|Compose|{{tt|~}}|{{tt|a}}|chain=}}ã
| {{key press|Compose|{{tt|^}}|{{tt|a}}|chain=}}â
| {{key press|Compose|{{tt|c}}|{{tt|a}}|chain=}}ǎ
| {{key press|Compose|{{tt|o}}|{{tt|a}}|chain=}}å
| {{key press|Compose|{{tt
}}|{{tt|a}}|chain=}}ā
| {{key press|Compose|{{tt|,}}|{{tt|a}}|chain=}}ą
| {{key press|Compose|{{tt|u}}|{{tt|a}}|chain=}}ă
| {{key press|Compose|{{tt|?}}|{{tt|a}}|chain=}}
| {{key press|Compose|{{tt|.}}|{{tt|a}}|chain=}}ȧ
colspan="2" | Above work for
most uppercase and
lowercase vowels.

|

class="wikitable nounderlines"

!type!!for

| {{key press|Compose|{{tt|a}}|{{tt|e}}|chain=}}æ
| {{key press|Compose|{{tt|A}}|{{tt|E}}|chain=}}Æ
| {{key press|Compose|{{tt|o}}|{{tt|e}}|chain=}}œ
| {{key press|Compose|{{tt|O}}|{{tt|E}}|chain=}}Œ
| {{key press|Compose|{{tt|d}}|{{tt|h}}|chain=}}ð
| {{key press|Compose|{{tt|D}}|{{tt|H}}|chain=}}Ð
| {{key press|Compose|{{tt|o}}|{{tt|o}}|chain=}}°
| {{key press|Compose|{{tt|o}}|{{tt|x}}|chain=}}¤
| {{key press|Compose|{{tt|o}}|{{tt|c}}|chain=}}©
| {{key press|Compose|{{tt|o}}|{{tt|r}}|chain=}}®
| {{key press|Compose|{{tt|s}}|{{tt|o}}|chain=}}§
| {{key press|Compose|{{tt|s}}|{{tt|s}}|chain=}}ß
| {{key press|Compose|{{tt|S}}|{{tt|S}}|chain=}}
| {{key press|Compose|{{tt|t}}|{{tt|h}}|chain=}}þ
| {{key press|Compose|{{tt|T}}|{{tt|H}}|chain=}}Þ
| {{key press|Compose|{{tt|t}}|{{tt|m}}|chain=}}
| {{key press|Compose|{{tt|x}}|{{tt|x}}|chain=}}×
| {{key press|Compose|{{tt|.}}|{{tt|.}}|chain=}}
| {{key press|Compose|{{tt|.}}|{{tt|^}}|chain=}}·

|

class="wikitable nounderlines"

!type!!for

| {{key press|Compose|{{tt|<}}|{{tt|<}}|chain=}}«
| {{key press|Compose|{{tt|>}}|{{tt|>}}|chain=}}»
| {{key press|Compose|{{tt|/}}|{{tt|/}}|chain=}}\
| {{key press|Compose|{{tt|/}}|{{tt|C}}|chain=}}
| {{key press|Compose|{{tt|/}}|{{tt|o}}|chain=}}ø
| {{key press|Compose|{{tt|/}}|{{tt|O}}|chain=}}Ø
| {{key press|Compose|{{tt|?}}|{{tt|?}}|chain=}}¿
| {{key press|Compose|{{tt|'}}|{{tt|<}}|chain=}}
| {{key press|Compose|{{tt|'}}|{{tt|>}}|chain=}}
| {{key press|Compose|{{tt|,}}|{{tt|c}}|chain=}}ç
| {{key press|Compose|{{tt|,}}|{{tt|C}}|chain=}}Ç
| {{key press|Compose|{{tt|"}}|{{tt|<}}|chain=}}
| {{key press|Compose|{{tt|"}}|{{tt|>}}|chain=}}
| {{key press|Compose|{{tt|!}}|{{tt|!}}|chain=}}¡
| {{key press|Compose|{{tt
}}|{{tt
}}|{{tt
}}|chain=}}
| {{key press|Compose|{{tt
}}|{{tt
}}|{{tt|.}}|chain=}}
| {{key press|Compose|{{tt
}}|{{tt|:}}|chain=}}÷
| {{key press|Compose|{{tt
}}|{{tt|d}}|chain=}}đ
| {{key press|Compose|{{tt
}}|{{tt|D}}|chain=}}Đ

|

class="wikitable nounderlines"

!type!!for

| {{key press|Compose|{{tt
}}|{{tt|L}}|chain=}}£
| {{key press|Compose|{{tt|^}}|{{tt|0}}|chain=}}
| {{key press|Compose|{{tt|^}}|{{tt|1}}|chain=}}¹
| {{key press|Compose|{{tt|^}}|{{tt|2}}|chain=}}²
| {{key press|Compose|{{tt|^}}|{{tt|3}}|chain=}}³
| {{key press|Compose|{{tt|^}}|{{tt|_}}|{{tt|a}}|chain=}}ª
| {{key press|Compose|{{tt|^}}|{{tt|_}}|{{tt|o}}|chain=}}º
| {{key press|Compose|{{tt|_}}|{{tt|0}}|chain=}}
| {{key press|Compose|{{tt|_}}|{{tt|1}}|chain=}}
| {{key press|Compose|{{tt|_}}|{{tt|2}}|chain=}}
| {{key press|Compose|{{tt|_}}|{{tt|3}}|chain=}}
| {{key press|Compose|{{tt|~}}|{{tt|n}}|chain=}}ñ
| {{key press|Compose|{{tt|<}}|{{tt|s}}|chain=}}š
| {{key press|Compose|{{tt|{{pipe}}}}|{{tt|c}}|chain=}}¢
| {{key press|Compose|{{tt|{{=}}}}|{{tt|y}}|chain=}}¥
| {{key press|Compose|{{tt|{{=}}}}|{{tt|p}}|chain=}}
| {{key press|Compose|{{tt|{{=}}}}|{{tt|c}}|chain=}}
| {{key press|Compose|{{tt|1}}|{{tt|2}}|chain=}}½
| {{key press|Compose|{{tt|1}}|{{tt|4}}|chain=}}¼
| {{key press|Compose|{{tt|3}}|{{tt|4}}|chain=}}¾

|}

See also

  • {{anli|Combining character}}
  • {{anli|Digraphs and trigraphs (programming)}}

Notes

{{notelist}}

References

{{Reflist|30em}}