Alt code explained

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 key, then typing a number on the keyboard's numeric keypad that identifies the character and then releasing .[1]

MS-DOS

On IBM PC compatible personal computers from the 1980s, the BIOS allowed the user to hold down the 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, [[List of DOS commands#CHCP|CHCP]] or [[List of DOS commands#MODE|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 . While some (most?) applications would insert a bullet character (code point 7 on code page 437), some would treat this identical to which often was a command for the program.

Windows

The Alt codes had become so well known and memorized by users that Microsoft decided to preserve them in Microsoft Windows, even though the OS features a newer and different set of code pages, such as CP1252. Windows includes the following processing algorithm for Alt code, which supports both methods:

Unicode

Later versions of Windows and applications such as Microsoft Word supported Unicode. As Unicode included all the characters in the MSDOS code pages, this had the immediate benefit that all the old MSDOS Alt combinations worked, not just the ones that existed in the Windows Code Page.

In the IBM PC Bios typing an Alt code greater than 255 produced the same as that number modulo 256.[3] Some applications retained this behavior, while others (in particular applications using the Windows RichEdit control, such as WordPad and PSPad) made numbers from 256 to 65,535 produce the corresponding Unicode character.[4] For instance, + in WordPad produces the . If the Windows Code Page was set to CP1252 then all Unicode characters except control characters could be typed this way.

Alternatives

Because most Unicode documentation and character tables 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 –). To enable it, a user must set or create a string type 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 will produce  (e with caron).

There are many other ways of typing arbitrary Unicode characters, such as the Character Map utility.

Other operating systems

The Alt key method does not work on ChromeOS, macOS, Linux or other operating systems and there is no evidence of interest in replicating it. However, numeric entry of Unicode characters is possible in most Unix or Unix-like OSs by pressing and releasing, and typing the hex number followed by the space bar or enter key. For example,

Limitations

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

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
­U+00AD2400173SOFT HYPHEN
U+00AE1690174REGISTERED SIGN
¯U+00AF2380175MACRON
°U+00B02480176DEGREE SIGN
±U+00B12410177PLUS-MINUS SIGN
2U+00B22530178SUPERSCRIPT TWO
3U+00B32520179SUPERSCRIPT THREE
´U+00B42390180ACUTE ACCENT
μU+00B52300181MICRO SIGN
U+00B6202440182PILCROW SIGN
·U+00B72500183MIDDLE DOT
¸U+00B82470184CEDILLA
1U+00B92510185SUPERSCRIPT ONE
ºU+00BA1670186MASCULINE ORDINAL INDICATOR
»U+00BB1750187RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
U+00BC1720188VULGAR FRACTION ONE QUARTER
U+00BD1710189VULGAR FRACTION ONE HALF
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+0152colspan=2 0140LATIN CAPITAL LIGATURE OE
œU+0153colspan=2 0156LATIN SMALL LIGATURE OE
ŠU+0160colspan=2 0138LATIN CAPITAL LETTER S WITH CARON
šU+0161colspan=2 0154LATIN SMALL LETTER S WITH CARON
ŸU+0178colspan=2 0159LATIN CAPITAL LETTER Y WITH DIAERESIS
ŽU+017Dcolspan=2 0142LATIN CAPITAL LETTER Z WITH CARON
žU+017Ecolspan=2 0158LATIN SMALL LETTER Z WITH CARON
ƒU+01921590131LATIN SMALL LETTER F WITH HOOK
ˆU+02C6colspan=2 0136MODIFIER LETTER CIRCUMFLEX ACCENT
˜U+02DCcolspan=2 0152SMALL TILDE
ΓU+0393226colspan=2 GREEK CAPITAL LETTER GAMMA
ΘU+0398233colspan=2 GREEK CAPITAL LETTER THETA
ΣU+03A3228colspan=2 GREEK CAPITAL LETTER SIGMA
ΦU+03A6232colspan=2 GREEK CAPITAL LETTER PHI
ΩU+03A9234colspan=2 GREEK CAPITAL LETTER OMEGA
αU+03B1224colspan=2 GREEK SMALL LETTER ALPHA
δU+03B4235colspan=2 GREEK SMALL LETTER DELTA
εU+03B5238colspan=2 GREEK SMALL LETTER EPSILON
πU+03C0227colspan=2 GREEK SMALL LETTER PI
σU+03C3229colspan=2 GREEK SMALL LETTER SIGMA
τU+03C4231colspan=2 GREEK SMALL LETTER TAU
φU+03C6237colspan=2 GREEK SMALL LETTER PHI
U+2013colspan=2 0150EN DASH
U+2014colspan=2 0151EM DASH
U+2017242DOUBLE LOW LINE
U+2018colspan=2 0145LEFT SINGLE QUOTATION MARK
U+2019colspan=2 0146RIGHT SINGLE QUOTATION MARK
U+201Acolspan=2 0130SINGLE LOW-9 QUOTATION MARK
U+201Ccolspan=2 0147LEFT DOUBLE QUOTATION MARK
U+201Dcolspan=2 0148RIGHT DOUBLE QUOTATION MARK
U+201Ecolspan=2 0132DOUBLE LOW-9 QUOTATION MARK
U+2020colspan=2 0134DAGGER
U+2021colspan=2 0135DOUBLE DAGGER
U+202270149BULLET
...U+2026colspan=2 0133HORIZONTAL ELLIPSIS
U+2030colspan=2 0137PER MILLE SIGN
U+2039colspan=2 0139SINGLE LEFT-POINTING ANGLE QUOTATION MARK
U+203Acolspan=2 0155SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
U+203C19DOUBLE EXCLAMATION MARK
nU+207F252colspan=2 SUPERSCRIPT LATIN SMALL LETTER N
U+20A7158colspan=2 PESETA SIGN
U+20ACcolspan=2 0128EURO SIGN
U+2122colspan=2 0153TRADE 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+2219249colspan=2 BULLET OPERATOR
U+221A251colspan=2 SQUARE ROOT
U+221E236colspan=2 INFINITY
U+221F28RIGHT ANGLE
U+2229239colspan=2 INTERSECTION
U+2248247colspan=2 ALMOST EQUAL TO
U+2264243colspan=2 LESS-THAN OR EQUAL TO
U+2261240colspan=2 IDENTICAL TO
U+2265242colspan=2 GREATER-THAN OR EQUAL TO
U+2302127HOUSE
U+2310169colspan=2 REVERSED NOT SIGN
U+2320244colspan=2 TOP HALF INTEGRAL
U+2321245colspan=2 BOTTOM 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+2552213colspan=2 BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
U+2553214colspan=2 BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
U+2554201BOX DRAWINGS DOUBLE DOWN AND RIGHT
U+2555184colspan=2 BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
U+2556183colspan=2 BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
U+2557187BOX DRAWINGS DOUBLE DOWN AND LEFT
U+2558212colspan=2 BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
U+2559211colspan=2 BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
U+255A200BOX DRAWINGS DOUBLE UP AND RIGHT
U+255B190colspan=2 BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
U+255C189colspan=2 BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
U+255D188BOX DRAWINGS DOUBLE UP AND LEFT
U+255E198colspan=2 BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
U+255F199colspan=2 BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
U+2560204BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
U+2562182colspan=2 BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
U+2563185BOX DRAWINGS DOUBLE VERTICAL AND LEFT
U+2564209colspan=2 BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
U+2565210colspan=2 BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
U+2566203BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
U+2567207colspan=2 BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
U+2568208colspan=2 BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
U+2569202BOX DRAWINGS DOUBLE UP AND HORIZONTAL
U+256A216colspan=2 BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
U+256B215colspan=2 BOX 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+258C221colspan=2 LEFT HALF BLOCK
U+2590222colspan=2 RIGHT 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 and References

  1. Web site: Alt Codes List of Alt Key Codes Symbols. 2022-02-23. www.alt-codes.net.
  2. Web site: 2016-07-22 . To input characters that are not on your keyboard . dead . https://web.archive.org/web/20160722031546/http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/lang_char_code_input.mspx?mfr=true . 2016-07-22 . 2022-12-30 . Microsoft .
  3. Web site: Raymond . Chen . The history of Alt+number sequences, and why Alt+9731 sometimes gives you a heart and sometimes a snowman . The Old New Thing . Microsoft . 2 July 2024 .
  4. Web site: Walker . Jim . etal . About Rich Edit Controls . Windows App Development . Microsoft . . 27 April 2022.