Alt code

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

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[edit]

MS DOS[edit]

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 a code to be placed on the screen at the location of the cursor, thus displaying the corresponding 8-bit character from the current code page. On the original IBM PC this was CP437.[a] In most cases typing a number greater than 255 produced the character associated with the remainder after the number is divided by 256.

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.[where?][clarification needed] 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, but MS DOS did not interpret the numbers this way. For instance, code point 7 is assigned to BEL. However with some applications, Alt+7 may yield a bullet character (code point 7 on code page 437), but in others would treat this input as identical to Ctrl+G (which on a terminal produces a control character with a value of 7).[citation needed]

Windows[edit]

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,[b] The familiar Alt+number combinations produced codes from the OEM code page (for example, CP437 in the United States),[c] 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, 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.[d]

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

Before Unicode was introduced, most Windows software could only create text using the repertoire of characters available in a single code page. Characters that did not exist in that page (such as a line-drawing graphic from the OEM page when the software was using the Windows code page) could not be inserted, and either were ignored or produced an unexpected character.[citation needed] Modern software uses Unicode, which assigns numbers (code points) to all the characters in all the code pages. The software has access to the glyphs corresponding to all the code points in the supported fonts, so it can produce the character specified by any Alt code less than 256 whether zero-prefixed or non-zero-prefixed.

Transition to Unicode[edit]

When Windows later transitioned to Unicode, 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. Other Windows applications, including Notepad, Chrome, Firefox, and Microsoft Edge interpret all numbers greater than 255 modulo 256.[citation needed]

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 numbers to be typed 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.[citation needed] A leading + then indicates hex input, for example Alt++11B will produce ě (e with caron).

Many applications, including Word, Wordpad, Excel, and LibreOffice, support a simpler method: typing the hex digits first (inserting them into the document) and then typing Alt+X to change them into the matching Unicode character.

Problems[edit]

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.[citation needed]

Other operating systems[edit]

The Alt key method does not work on Chrome OS, Mac OS, 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[edit]

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[edit]

Unicode CP437 CP850 CP1252 Unicode name
  U+00A0 255 0160 NO-BREAK SPACE
¡ U+00A1 173 0161 INVERTED EXCLAMATION MARK
¢ U+00A2 155 189 0162 CENT SIGN
£ U+00A3 156 0163 POUND SIGN
¤ U+00A4 207 0164 CURRENCY SIGN
¥ U+00A5 157 190 0165 YEN SIGN
¦ U+00A6 221 0166 BROKEN BAR
§ U+00A7 21 245 0167 SECTION SIGN
¨ U+00A8 249 0168 DIAERESIS
© U+00A9 184 0169 COPYRIGHT SIGN
ª U+00AA 166 0170 FEMININE ORDINAL INDICATOR
« U+00AB 174 0171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
¬ U+00AC 170 0172 NOT SIGN
­[e] U+00AD 240 0173 SOFT HYPHEN
® U+00AE 169 0174 REGISTERED SIGN
¯ U+00AF 238 0175 MACRON
° U+00B0 248 0176 DEGREE SIGN
± U+00B1 241 0177 PLUS-MINUS SIGN
2 U+00B2 253 0178 SUPERSCRIPT TWO
3 U+00B3 252 0179 SUPERSCRIPT THREE
´ U+00B4 239 0180 ACUTE ACCENT
μ U+00B5 230 0181 MICRO SIGN
U+00B6 20 244 0182 PILCROW SIGN
· U+00B7 250 0183 MIDDLE DOT
¸ U+00B8 247 0184 CEDILLA
1 U+00B9 251 0185 SUPERSCRIPT ONE
º U+00BA 167 0186 MASCULINE ORDINAL INDICATOR
» U+00BB 175 0187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
14 U+00BC 172 0188 VULGAR FRACTION ONE QUARTER
12 U+00BD 171 0189 VULGAR FRACTION ONE HALF
34 U+00BE 243 0190 VULGAR FRACTION THREE QUARTERS
¿ U+00BF 168 0191 INVERTED QUESTION MARK
À U+00C0 183 0192 LATIN CAPITAL LETTER A WITH GRAVE
Á U+00C1 181 0193 LATIN CAPITAL LETTER A WITH ACUTE
 U+00C2 182 0194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
à U+00C3 199 0195 LATIN CAPITAL LETTER A WITH TILDE
Ä U+00C4 142 0196 LATIN CAPITAL LETTER A WITH DIAERESIS
Å U+00C5 143 0197 LATIN CAPITAL LETTER A WITH RING ABOVE
Æ U+00C6 146 0198 LATIN CAPITAL LETTER AE
Ç U+00C7 128 0199 LATIN CAPITAL LETTER C WITH CEDILLA
È U+00C8 212 0200 LATIN CAPITAL LETTER E WITH GRAVE
É U+00C9 144 0201 LATIN CAPITAL LETTER E WITH ACUTE
Ê U+00CA 210 0202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX
Ë U+00CB 211 0203 LATIN CAPITAL LETTER E WITH DIAERESIS
Ì U+00CC 222 0204 LATIN CAPITAL LETTER I WITH GRAVE
Í U+00CD 214 0205 LATIN CAPITAL LETTER I WITH ACUTE
Î U+00CE 215 0206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX
Ï U+00CF 216 0207 LATIN CAPITAL LETTER I WITH DIAERESIS
Ð U+00D0 209 0208 LATIN CAPITAL LETTER ETH
Ñ U+00D1 165 0209 LATIN CAPITAL LETTER N WITH TILDE
Ò U+00D2 227 0210 LATIN CAPITAL LETTER O WITH GRAVE
Ó U+00D3 224 0211 LATIN CAPITAL LETTER O WITH ACUTE
Ô U+00D4 226 0212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
Õ U+00D5 229 0213 LATIN CAPITAL LETTER O WITH TILDE
Ö U+00D6 153 0214 LATIN CAPITAL LETTER O WITH DIAERESIS
× U+00D7 158 0215 MULTIPLICATION SIGN
Ø U+00D8 157 0216 LATIN CAPITAL LETTER O WITH STROKE
Ù U+00D9 235 0217 LATIN CAPITAL LETTER U WITH GRAVE
Ú U+00DA 233 0218 LATIN CAPITAL LETTER U WITH ACUTE
Û U+00DB 234 0219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX
Ü U+00DC 154 0220 LATIN CAPITAL LETTER U WITH DIAERESIS
Ý U+00DD 237 0221 LATIN CAPITAL LETTER Y WITH ACUTE
Þ U+00DE 232 0222 LATIN CAPITAL LETTER THORN
ß U+00DF 225 0223 LATIN SMALL LETTER SHARP S
à U+00E0 133 0224 LATIN SMALL LETTER A WITH GRAVE
á U+00E1 160 0225 LATIN SMALL LETTER A WITH ACUTE
â U+00E2 131 0226 LATIN SMALL LETTER A WITH CIRCUMFLEX
ã U+00E3 198 0227 LATIN SMALL LETTER A WITH TILDE
ä U+00E4 132 0228 LATIN SMALL LETTER A WITH DIAERESIS
å U+00E5 134 0229 LATIN SMALL LETTER A WITH RING ABOVE
æ U+00E6 145 0230 LATIN SMALL LETTER AE
ç U+00E7 135 0231 LATIN SMALL LETTER C WITH CEDILLA
è U+00E8 138 0232 LATIN SMALL LETTER E WITH GRAVE
é U+00E9 130 0233 LATIN SMALL LETTER E WITH ACUTE
ê U+00EA 136 0234 LATIN SMALL LETTER E WITH CIRCUMFLEX
ë U+00EB 137 0235 LATIN SMALL LETTER E WITH DIAERESIS
ì U+00EC 141 0236 LATIN SMALL LETTER I WITH GRAVE
í U+00ED 161 0237 LATIN SMALL LETTER I WITH ACUTE
î U+00EE 140 0238 LATIN SMALL LETTER I WITH CIRCUMFLEX
ï U+00EF 139 0239 LATIN SMALL LETTER I WITH DIAERESIS
ð U+00F0 208 0240 LATIN SMALL LETTER ETH
ñ U+00F1 164 0241 LATIN SMALL LETTER N WITH TILDE
ò U+00F2 149 0242 LATIN SMALL LETTER O WITH GRAVE
ó U+00F3 162 0243 LATIN SMALL LETTER O WITH ACUTE
ô U+00F4 147 0244 LATIN SMALL LETTER O WITH CIRCUMFLEX
õ U+00F5 228 0245 LATIN SMALL LETTER O WITH TILDE
ö U+00F6 148 0246 LATIN SMALL LETTER O WITH DIAERESIS
÷ U+00F7 246 0247 DIVISION SIGN
ø U+00F8 155 0248 LATIN SMALL LETTER O WITH STROKE
ù U+00F9 151 0249 LATIN SMALL LETTER U WITH GRAVE
ú U+00FA 163 0250 LATIN SMALL LETTER U WITH ACUTE
û U+00FB 150 0251 LATIN SMALL LETTER U WITH CIRCUMFLEX
ü U+00FC 129 0252 LATIN SMALL LETTER U WITH DIAERESIS
ý U+00FD 236 0253 LATIN SMALL LETTER Y WITH ACUTE
þ U+00FE 231 0254 LATIN SMALL LETTER THORN
ÿ U+00FF 152 0255 LATIN SMALL LETTER Y WITH DIAERESIS
ı U+0131 213 LATIN SMALL LETTER DOTLESS I
ΠU+0152 0140 LATIN CAPITAL LIGATURE OE
œ U+0153 0156 LATIN SMALL LIGATURE OE
Š U+0160 0138 LATIN CAPITAL LETTER S WITH CARON
š U+0161 0154 LATIN SMALL LETTER S WITH CARON
Ÿ U+0178 0159 LATIN CAPITAL LETTER Y WITH DIAERESIS
Ž U+017D 0142 LATIN CAPITAL LETTER Z WITH CARON
ž U+017E 0158 LATIN SMALL LETTER Z WITH CARON
ƒ U+0192 159 0131 LATIN SMALL LETTER F WITH HOOK
ˆ U+02C6 0136 MODIFIER LETTER CIRCUMFLEX ACCENT
˜ U+02DC 0152 SMALL TILDE
Γ U+0393 226 GREEK CAPITAL LETTER GAMMA
Θ U+0398 233 GREEK CAPITAL LETTER THETA
Σ U+03A3 228 GREEK CAPITAL LETTER SIGMA
Φ U+03A6 232 GREEK CAPITAL LETTER PHI
Ω U+03A9 234 GREEK CAPITAL LETTER OMEGA
α U+03B1 224 GREEK SMALL LETTER ALPHA
δ U+03B4 235 GREEK SMALL LETTER DELTA
ε U+03B5 238 GREEK SMALL LETTER EPSILON
π U+03C0 227 GREEK SMALL LETTER PI
σ U+03C3 229 GREEK SMALL LETTER SIGMA
τ U+03C4 231 GREEK SMALL LETTER TAU
φ U+03C6 237 GREEK SMALL LETTER PHI
U+2013 0150 EN DASH
U+2014 0151 EM DASH
U+2017 242 DOUBLE LOW LINE
U+2018 0145 LEFT SINGLE QUOTATION MARK
U+2019 0146 RIGHT SINGLE QUOTATION MARK
U+201A 0130 SINGLE LOW-9 QUOTATION MARK
U+201C 0147 LEFT DOUBLE QUOTATION MARK
U+201D 0148 RIGHT DOUBLE QUOTATION MARK
U+201E 0132 DOUBLE LOW-9 QUOTATION MARK
U+2020 0134 DAGGER
U+2021 0135 DOUBLE DAGGER
U+2022 7 0149 BULLET
... U+2026 0133 HORIZONTAL ELLIPSIS
U+2030 0137 PER MILLE SIGN
U+2039 0139 SINGLE LEFT-POINTING ANGLE QUOTATION MARK
U+203A 0155 SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
U+203C 19 DOUBLE EXCLAMATION MARK
n U+207F 252 SUPERSCRIPT LATIN SMALL LETTER N
U+20A7 158 PESETA SIGN
U+20AC 0128 EURO SIGN
U+2122 0153 TRADE MARK SIGN
U+2190 27 LEFTWARDS ARROW
U+2192 26 RIGHTWARDS ARROW
U+2193 25 DOWNWARDS ARROW
U+2194 29 LEFT RIGHT ARROW
U+2195 18 UP DOWN ARROW
U+21A8 23 UP DOWN ARROW WITH BASE
U+2219 249 BULLET OPERATOR
U+221A 251 SQUARE ROOT
U+221E 236 INFINITY
U+221F 28 RIGHT ANGLE
U+2229 239 INTERSECTION
U+2248 247 ALMOST EQUAL TO
U+2264 243 LESS-THAN OR EQUAL TO
U+2265 242 GREATER-THAN OR EQUAL TO
U+2302 127 HOUSE
U+2310 169 REVERSED NOT SIGN
U+2320 244 TOP HALF INTEGRAL
U+2500 196 BOX DRAWINGS LIGHT HORIZONTAL
U+2502 179 BOX DRAWINGS LIGHT VERTICAL
U+250C 218 BOX DRAWINGS LIGHT DOWN AND RIGHT
U+2510 191 BOX DRAWINGS LIGHT DOWN AND LEFT
U+2514 192 BOX DRAWINGS LIGHT UP AND RIGHT
U+2518 217 BOX DRAWINGS LIGHT UP AND LEFT
U+251C 195 BOX DRAWINGS LIGHT VERTICAL AND RIGHT
U+2524 180 BOX DRAWINGS LIGHT VERTICAL AND LEFT
U+252C 194 BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
U+2534 193 BOX DRAWINGS LIGHT UP AND HORIZONTAL
U+253C 197 BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
U+2550 205 BOX DRAWINGS DOUBLE HORIZONTAL
U+2551 186 BOX DRAWINGS DOUBLE VERTICAL
U+2552 213 BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
U+2553 214 BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
U+2554 201 BOX DRAWINGS DOUBLE DOWN AND RIGHT
U+2555 184 BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
U+2556 183 BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
U+2557 187 BOX DRAWINGS DOUBLE DOWN AND LEFT
U+2558 212 BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
U+2559 211 BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
U+255A 200 BOX DRAWINGS DOUBLE UP AND RIGHT
U+255B 190 BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
U+255C 189 BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
U+255D 188 BOX DRAWINGS DOUBLE UP AND LEFT
U+255E 198 BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
U+255F 199 BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
U+2560 204 BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
U+2562 182 BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
U+2563 185 BOX DRAWINGS DOUBLE VERTICAL AND LEFT
U+2564 209 BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
U+2565 210 BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
U+2566 203 BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
U+2567 207 BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
U+2568 208 BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
U+2569 202 BOX DRAWINGS DOUBLE UP AND HORIZONTAL
U+256A 216 BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
U+256B 215 BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
U+256C 206 BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
U+2580 223 UPPER HALF BLOCK
U+2584 220 LOWER HALF BLOCK
U+2588 219 FULL BLOCK
U+258C 221 LEFT HALF BLOCK
U+2590 222 RIGHT HALF BLOCK
U+2591 176 LIGHT SHADE
U+2592 177 MEDIUM SHADE
U+2593 178 DARK SHADE
U+25A0 254 BLACK SQUARE
U+25AC 22 BLACK RECTANGLE
U+25B2 30 BLACK UP-POINTING TRIANGLE
U+25BA 16 BLACK RIGHT-POINTING POINTER
U+25BC 31 BLACK DOWN-POINTING TRIANGLE
U+25C4 17 BLACK LEFT-POINTING POINTER
U+25CB 9 WHITE CIRCLE
U+25D8 8 INVERSE BULLET
U+25D9 10 INVERSE WHITE CIRCLE
U+263A 1 WHITE SMILING FACE
U+263B 2 BLACK SMILING FACE
U+263C 15 WHITE SUN WITH RAYS
U+2640 12 FEMALE SIGN
U+2642 11 MALE SIGN
U+2660 6 BLACK SPADE SUIT
U+2663 5 BLACK CLUB SUIT
U+2665 3 BLACK HEART SUIT
U+2666 4 BLACK DIAMOND SUIT
U+266A 13 EIGHTH NOTE
U+266B 14 BEAMED EIGHTH NOTES

See also[edit]

Notes[edit]

  1. ^ See article CP437 for a list of the numbers accepted
  2. ^ Initially these were called "ANSI" code pages, but Microsoft has acknowledged that this was a misnomer.
  3. ^ Simplifying a bit by not taking 16-bit DBCS code pages into account here.
  4. ^ See CP1252 for a list of these zero-prefixed alt combinations
  5. ^ Only visible at a line break that falls between syllables of a word, where it appears as a hyphen-minus, -.

References[edit]

  1. ^ "Alt Codes List of Alt Key Codes Symbols". www.alt-codes.net. Retrieved 2022-02-23.