Alt code

On personal computers with numeric keypads that use Microsoft operating systems, such as Windows, many characters that do not have a dedicated key combination on the keyboard may nevertheless be entered using the Alt code (the Alt numpad input method). This is done by pressing and holding the Alt key, then typing a number on the keyboard's numeric keypad that identifies the character and then releasing Alt.[1]

History and description

MS DOS

On IBM PC compatible personal computers from the 1980s, the BIOS allowed the user to hold down the Alt key and type a decimal number on the keypad. It would place the corresponding code into the keyboard buffer so that it would look (almost) as if the code had been entered by a single keystroke. Applications reading keystrokes from the BIOS would behave according to what action they associate with that code. Some would interpret the code as a command, but often it would be interpreted as an 8-bit character from the current code page that was inserted into the text the user was typing. On the original IBM PC the code page was CP437.

Some Eastern European, Arabic and Asian computers used other hardware code pages, and MS-DOS was able to switch between them at runtime with commands like KEYB, CHCP or MODE. This causes the Alt combinations to produce different characters (as well as changing the display of any previously-entered text in the same manner). A common choice in locales using variants of the Latin alphabet was CP850, which provided more Latin character variants. (There were, however, many more code pages; for a more complete list, see code page).

PC keyboards designed for non-English use included other methods of inserting these characters, such as national keyboard layouts, the AltGr key or dead keys, but the Alt key was the only method of inserting some characters, and the only method that was the same on all machines, so it remained very popular. This input method is emulated by many pieces of software (such as later versions of MS-DOS and Windows) that do not use the BIOS keyboard decoding.

In the ASCII standard, the numbers 0-31 and 127 are assigned to control characters, for instance, code point 7 is typed by Ctrl+G. While some (most?) applications would insert a bullet character (code point 7 on code page 437), some would treat this identical to Ctrl+G which often was a command for the program.

Typing a number greater than 255 produced the character associated with the remainder after the number is divided by 256.

Windows

The Alt codes had become so well known and memorized by users that Microsoft decided to preserve them, even though it used a new and different set of code pages for Windows, such as CP1252. The old code pages were called OEM code pages; the new ones are called Windows code pages,[lower-alpha 1] The familiar Alt+number combinations produced codes from the OEM code page (for example, CP437 in the United States), matching the results from MS-DOS. But prefixing a leading zero (0) to the number (usually meaning 4 digits) produced the character specified by the newer Windows code page,[lower-alpha 2] allowing them to be typed as well.

For instance, the combination Alt+163 would result in ú (Latin letter u with acute accent) which is at 163 in the OEM code page of CP437 or CP850, while Alt+0163 yields the character £ (symbol for the pound sterling) which is at 163 in CP1252.[2]

The numbers 0 –31 and 127 are control characters in the Windows code pages. Typing these numbers with a leading zero is ignored.

Before Unicode was introduced, most Windows software could only create text using the repertoire of characters available in a single Windows code page. Characters that did not exist in that page (such as a line-drawing graphic from the OEM page) could not be inserted, and either were ignored or produced an unexpected character.

Transition to Unicode

When Windows later transitioned to Unicode, all the characters from both the OEM and Windows code pages were available, actually improving the emulation of the oldest MSDOS Alt codes.

There was a desire to extend the Alt codes to allow entry of any Unicode code point. Numbers greater or equal to 256 pick the corresponding Unicode code point (lower numbers continue to pick characters from the OEM or ANSI code pages, but if 0 is prefixed the ANSI code page greatly resembles the first 256 characters of Unicode). Some applications (RichEdit-based) like Word 2010, Wordpad, and PSPad operate this way.[3] Other Windows applications, including Notepad, Chrome, Firefox, and Microsoft Edge interpret all numbers greater than 255 modulo 256.

Because most Unicode documentation and the Character Map accessory show the code points in hex, not decimal, a variation of Alt codes was developed to allow the typing of numbers in hex (using the main keyboard for AF). To enable it, a user must set or create a string type (REG_SZ) value called EnableHexNumpad in the registry key HKEY_CURRENT_USER\Control Panel\Input Method, assign the value data 1 to it, and then reboot or log out/in. A leading + then indicates hex input, for example Alt++11B will produce ě (e with caron).

Problems

If Num lock is disabled, attempting an Alt code may cause unexpected results in some applications, due to the controls used on the same key. For example, Alt+4 can be taken as Alt+, causing a web browser to go back one page.

Many laptops do not have a separate numeric keypad, but some may provide numpad input by holding a modifier key (typically labelled "Fn"); thus one must press and hold both Alt and Fn keys while entering the character code.

One limitation of the Alt code feature is that the Alt key and the numpad keys being used to enter the code must both be on the same keyboard device. Users with keyboards that lack a numpad (e.g. tenkeyless designs) cannot use a separate numpad device to enter Alt codes while holding the Alt key on their main keyboard.

Other operating systems

The Alt key method does not work on ChromeOS, macOS, Linux or other operating systems and there is no readily-accessible evidence of interest in replicating it, due to its including the 1980s IBM PC character encoding as part of its definition. However, numeric entry of Unicode characters is possible in most Unix or Unix-like OSs by typing Ctrl+⇧ Shift+U, (release) then the hex number, then the space bar or enter key. For example,

Alternatives

Alternative systems exist for users to make characters without selecting them by number, for example using a popup window that lets a user choose the desired character by clicking on it. Examples include the Windows Character Map or the Insert Character facility in MsOffice. See Unicode input for more.

List of codes

UnicodeCP437CP850CP1252Unicode name
  U+00A02550160NO-BREAK SPACE
¡ U+00A11730161INVERTED EXCLAMATION MARK
¢ U+00A21551890162CENT SIGN
£ U+00A31560163POUND SIGN
¤ U+00A42070164CURRENCY SIGN
¥ U+00A51571900165YEN SIGN
¦ U+00A62210166BROKEN BAR
§ U+00A7212450167SECTION SIGN
¨ U+00A82490168DIAERESIS
© U+00A91840169COPYRIGHT SIGN
ª U+00AA1660170FEMININE ORDINAL INDICATOR
« U+00AB1740171LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
¬ U+00AC1700172NOT SIGN
­[lower-alpha 3] U+00AD2400173SOFT HYPHEN
® U+00AE1690174REGISTERED SIGN
¯ U+00AF2380175MACRON
° U+00B02480176DEGREE SIGN
± U+00B12410177PLUS-MINUS SIGN
2 U+00B22530178SUPERSCRIPT TWO
3 U+00B32520179SUPERSCRIPT THREE
´ U+00B42390180ACUTE ACCENT
μ U+00B52300181MICRO SIGN
U+00B6202440182PILCROW SIGN
· U+00B72500183MIDDLE DOT
¸ U+00B82470184CEDILLA
1 U+00B92510185SUPERSCRIPT ONE
º U+00BA1670186MASCULINE ORDINAL INDICATOR
» U+00BB1750187RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
14 U+00BC1720188VULGAR FRACTION ONE QUARTER
12 U+00BD1710189VULGAR FRACTION ONE HALF
34 U+00BE2430190VULGAR FRACTION THREE QUARTERS
¿ U+00BF1680191INVERTED QUESTION MARK
À U+00C01830192LATIN CAPITAL LETTER A WITH GRAVE
Á U+00C11810193LATIN CAPITAL LETTER A WITH ACUTE
 U+00C21820194LATIN CAPITAL LETTER A WITH CIRCUMFLEX
à U+00C31990195LATIN CAPITAL LETTER A WITH TILDE
Ä U+00C41420196LATIN CAPITAL LETTER A WITH DIAERESIS
Å U+00C51430197LATIN CAPITAL LETTER A WITH RING ABOVE
Æ U+00C61460198LATIN CAPITAL LETTER AE
Ç U+00C71280199LATIN CAPITAL LETTER C WITH CEDILLA
È U+00C82120200LATIN CAPITAL LETTER E WITH GRAVE
É U+00C91440201LATIN CAPITAL LETTER E WITH ACUTE
Ê U+00CA2100202LATIN CAPITAL LETTER E WITH CIRCUMFLEX
Ë U+00CB2110203LATIN CAPITAL LETTER E WITH DIAERESIS
Ì U+00CC2220204LATIN CAPITAL LETTER I WITH GRAVE
Í U+00CD2140205LATIN CAPITAL LETTER I WITH ACUTE
Î U+00CE2150206LATIN CAPITAL LETTER I WITH CIRCUMFLEX
Ï U+00CF2160207LATIN CAPITAL LETTER I WITH DIAERESIS
Ð U+00D02090208LATIN CAPITAL LETTER ETH
Ñ U+00D11650209LATIN CAPITAL LETTER N WITH TILDE
Ò U+00D22270210LATIN CAPITAL LETTER O WITH GRAVE
Ó U+00D32240211LATIN CAPITAL LETTER O WITH ACUTE
Ô U+00D42260212LATIN CAPITAL LETTER O WITH CIRCUMFLEX
Õ U+00D52290213LATIN CAPITAL LETTER O WITH TILDE
Ö U+00D61530214LATIN CAPITAL LETTER O WITH DIAERESIS
× U+00D71580215MULTIPLICATION SIGN
Ø U+00D81570216LATIN CAPITAL LETTER O WITH STROKE
Ù U+00D92350217LATIN CAPITAL LETTER U WITH GRAVE
Ú U+00DA2330218LATIN CAPITAL LETTER U WITH ACUTE
Û U+00DB2340219LATIN CAPITAL LETTER U WITH CIRCUMFLEX
Ü U+00DC1540220LATIN CAPITAL LETTER U WITH DIAERESIS
Ý U+00DD2370221LATIN CAPITAL LETTER Y WITH ACUTE
Þ U+00DE2320222LATIN CAPITAL LETTER THORN
ß U+00DF2250223LATIN SMALL LETTER SHARP S
à U+00E01330224LATIN SMALL LETTER A WITH GRAVE
á U+00E11600225LATIN SMALL LETTER A WITH ACUTE
â U+00E21310226LATIN SMALL LETTER A WITH CIRCUMFLEX
ã U+00E31980227LATIN SMALL LETTER A WITH TILDE
ä U+00E41320228LATIN SMALL LETTER A WITH DIAERESIS
å U+00E51340229LATIN SMALL LETTER A WITH RING ABOVE
æ U+00E61450230LATIN SMALL LETTER AE
ç U+00E71350231LATIN SMALL LETTER C WITH CEDILLA
è U+00E81380232LATIN SMALL LETTER E WITH GRAVE
é U+00E91300233LATIN SMALL LETTER E WITH ACUTE
ê U+00EA1360234LATIN SMALL LETTER E WITH CIRCUMFLEX
ë U+00EB1370235LATIN SMALL LETTER E WITH DIAERESIS
ì U+00EC1410236LATIN SMALL LETTER I WITH GRAVE
í U+00ED1610237LATIN SMALL LETTER I WITH ACUTE
î U+00EE1400238LATIN SMALL LETTER I WITH CIRCUMFLEX
ï U+00EF1390239LATIN SMALL LETTER I WITH DIAERESIS
ð U+00F02080240LATIN SMALL LETTER ETH
ñ U+00F11640241LATIN SMALL LETTER N WITH TILDE
ò U+00F21490242LATIN SMALL LETTER O WITH GRAVE
ó U+00F31620243LATIN SMALL LETTER O WITH ACUTE
ô U+00F41470244LATIN SMALL LETTER O WITH CIRCUMFLEX
õ U+00F52280245LATIN SMALL LETTER O WITH TILDE
ö U+00F61480246LATIN SMALL LETTER O WITH DIAERESIS
÷ U+00F72460247DIVISION SIGN
ø U+00F81550248LATIN SMALL LETTER O WITH STROKE
ù U+00F91510249LATIN SMALL LETTER U WITH GRAVE
ú U+00FA1630250LATIN SMALL LETTER U WITH ACUTE
û U+00FB1500251LATIN SMALL LETTER U WITH CIRCUMFLEX
ü U+00FC1290252LATIN SMALL LETTER U WITH DIAERESIS
ý U+00FD2360253LATIN SMALL LETTER Y WITH ACUTE
þ U+00FE2310254LATIN SMALL LETTER THORN
ÿ U+00FF1520255LATIN SMALL LETTER Y WITH DIAERESIS
ı U+0131213LATIN SMALL LETTER DOTLESS I
ΠU+01520140LATIN CAPITAL LIGATURE OE
œ U+01530156LATIN SMALL LIGATURE OE
Š U+01600138LATIN CAPITAL LETTER S WITH CARON
š U+01610154LATIN SMALL LETTER S WITH CARON
Ÿ U+01780159LATIN CAPITAL LETTER Y WITH DIAERESIS
Ž U+017D0142LATIN CAPITAL LETTER Z WITH CARON
ž U+017E0158LATIN SMALL LETTER Z WITH CARON
ƒ U+01921590131LATIN SMALL LETTER F WITH HOOK
ˆ U+02C60136MODIFIER LETTER CIRCUMFLEX ACCENT
˜ U+02DC0152SMALL TILDE
Γ U+0393226GREEK CAPITAL LETTER GAMMA
Θ U+0398233GREEK CAPITAL LETTER THETA
Σ U+03A3228GREEK CAPITAL LETTER SIGMA
Φ U+03A6232GREEK CAPITAL LETTER PHI
Ω U+03A9234GREEK CAPITAL LETTER OMEGA
α U+03B1224GREEK SMALL LETTER ALPHA
δ U+03B4235GREEK SMALL LETTER DELTA
ε U+03B5238GREEK SMALL LETTER EPSILON
π U+03C0227GREEK SMALL LETTER PI
σ U+03C3229GREEK SMALL LETTER SIGMA
τ U+03C4231GREEK SMALL LETTER TAU
φ U+03C6237GREEK SMALL LETTER PHI
U+20130150EN DASH
U+20140151EM DASH
U+2017242DOUBLE LOW LINE
U+20180145LEFT SINGLE QUOTATION MARK
U+20190146RIGHT SINGLE QUOTATION MARK
U+201A0130SINGLE LOW-9 QUOTATION MARK
U+201C0147LEFT DOUBLE QUOTATION MARK
U+201D0148RIGHT DOUBLE QUOTATION MARK
U+201E0132DOUBLE LOW-9 QUOTATION MARK
U+20200134DAGGER
U+20210135DOUBLE DAGGER
U+202270149BULLET
... U+20260133HORIZONTAL ELLIPSIS
U+20300137PER MILLE SIGN
U+20390139SINGLE LEFT-POINTING ANGLE QUOTATION MARK
U+203A0155SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
U+203C19DOUBLE EXCLAMATION MARK
n U+207F252SUPERSCRIPT LATIN SMALL LETTER N
U+20A7158PESETA SIGN
U+20AC0128EURO SIGN
U+21220153TRADE MARK SIGN
U+219027LEFTWARDS ARROW
U+219124UPWARDS ARROW
U+219226RIGHTWARDS ARROW
U+219325DOWNWARDS ARROW
U+219429LEFT RIGHT ARROW
U+219518UP DOWN ARROW
U+21A823UP DOWN ARROW WITH BASE
U+2219249BULLET OPERATOR
U+221A251SQUARE ROOT
U+221E236INFINITY
U+221F28RIGHT ANGLE
U+2229239INTERSECTION
U+2248247ALMOST EQUAL TO
U+2264243LESS-THAN OR EQUAL TO
U+2261240IDENTICAL TO
U+2265242GREATER-THAN OR EQUAL TO
U+2302127HOUSE
U+2310169REVERSED NOT SIGN
U+2320244TOP HALF INTEGRAL
U+2321245BOTTOM HALF INTEGRAL
U+2500196BOX DRAWINGS LIGHT HORIZONTAL
U+2502179BOX DRAWINGS LIGHT VERTICAL
U+250C218BOX DRAWINGS LIGHT DOWN AND RIGHT
U+2510191BOX DRAWINGS LIGHT DOWN AND LEFT
U+2514192BOX DRAWINGS LIGHT UP AND RIGHT
U+2518217BOX DRAWINGS LIGHT UP AND LEFT
U+251C195BOX DRAWINGS LIGHT VERTICAL AND RIGHT
U+2524180BOX DRAWINGS LIGHT VERTICAL AND LEFT
U+252C194BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
U+2534193BOX DRAWINGS LIGHT UP AND HORIZONTAL
U+253C197BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
U+2550205BOX DRAWINGS DOUBLE HORIZONTAL
U+2551186BOX DRAWINGS DOUBLE VERTICAL
U+2552213BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
U+2553214BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
U+2554201BOX DRAWINGS DOUBLE DOWN AND RIGHT
U+2555184BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
U+2556183BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
U+2557187BOX DRAWINGS DOUBLE DOWN AND LEFT
U+2558212BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
U+2559211BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
U+255A200BOX DRAWINGS DOUBLE UP AND RIGHT
U+255B190BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
U+255C189BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
U+255D188BOX DRAWINGS DOUBLE UP AND LEFT
U+255E198BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
U+255F199BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
U+2560204BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
U+2562182BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
U+2563185BOX DRAWINGS DOUBLE VERTICAL AND LEFT
U+2564209BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
U+2565210BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
U+2566203BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
U+2567207BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
U+2568208BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
U+2569202BOX DRAWINGS DOUBLE UP AND HORIZONTAL
U+256A216BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
U+256B215BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
U+256C206BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
U+2580223UPPER HALF BLOCK
U+2584220LOWER HALF BLOCK
U+2588219FULL BLOCK
U+258C221LEFT HALF BLOCK
U+2590222RIGHT HALF BLOCK
U+2591176LIGHT SHADE
U+2592177MEDIUM SHADE
U+2593178DARK SHADE
U+25A0254BLACK SQUARE
U+25AC22BLACK RECTANGLE
U+25B230BLACK UP-POINTING TRIANGLE
U+25BA16BLACK RIGHT-POINTING POINTER
U+25BC31BLACK DOWN-POINTING TRIANGLE
U+25C417BLACK LEFT-POINTING POINTER
U+25CB9WHITE CIRCLE
U+25D88INVERSE BULLET
U+25D910INVERSE WHITE CIRCLE
U+263A1WHITE SMILING FACE
U+263B2BLACK SMILING FACE
U+263C15WHITE SUN WITH RAYS
U+264012FEMALE SIGN
U+264211MALE SIGN
U+26606BLACK SPADE SUIT
U+26635BLACK CLUB SUIT
U+26653BLACK HEART SUIT
U+26664BLACK DIAMOND SUIT
U+266A13EIGHTH NOTE
U+266B14BEAMED EIGHTH NOTES

See also

Notes

  1. Initially these were called "ANSI" code pages, but Microsoft has acknowledged that this was a misnomer.
  2. Simplifying a bit by not taking 16-bit DBCS code pages into account here.
  3. Only visible at a line break that falls between syllables of a word, where it appears as a hyphen-minus, -.

References

  1. "Alt Codes List of Alt Key Codes Symbols". www.alt-codes.net. Retrieved 2022-02-23.
  2. "To input characters that are not on your keyboard". microsoft.com. 2016-07-22. Archived from the original on 2016-07-22. Retrieved 2022-12-30.
  3. "About Rich Edit Controls - Win32 apps". learn.microsoft.com. Retrieved 2022-12-30.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.