15 |
@cindex input with the keyboard |
@cindex input with the keyboard |
16 |
@cindex keyboard input |
@cindex keyboard input |
17 |
@cindex character set (keyboard) |
@cindex character set (keyboard) |
18 |
@cindex ASCII |
@cindex @acronym{ASCII} |
19 |
@cindex C- |
@cindex C- |
20 |
@cindex Control |
@cindex Control |
21 |
@cindex control characters |
@cindex control characters |
22 |
|
|
23 |
GNU Emacs uses an extension of the ASCII character set for keyboard |
GNU Emacs uses an extension of the @acronym{ASCII} character set for keyboard |
24 |
input; it also accepts non-character input events including function |
input; it also accepts non-character input events including function |
25 |
keys and mouse button actions. |
keys and mouse button actions. |
26 |
|
|
27 |
ASCII consists of 128 character codes. Some of these codes are |
@acronym{ASCII} consists of 128 character codes. Some of these codes are |
28 |
assigned graphic symbols such as @samp{a} and @samp{=}; the rest are |
assigned graphic symbols such as @samp{a} and @samp{=}; the rest are |
29 |
control characters, such as @kbd{Control-a} (usually written @kbd{C-a} |
control characters, such as @kbd{Control-a} (usually written @kbd{C-a} |
30 |
for short). @kbd{C-a} gets its name from the fact that you type it by |
for short). @kbd{C-a} gets its name from the fact that you type it by |
31 |
holding down the @key{CTRL} key while pressing @kbd{a}. |
holding down the @key{CTRL} key while pressing @kbd{a}. |
32 |
|
|
33 |
Some ASCII control characters have special names, and most terminals |
Some @acronym{ASCII} control characters have special names, and most terminals |
34 |
have special keys you can type them with: for example, @key{RET}, |
have special keys you can type them with: for example, @key{RET}, |
35 |
@key{TAB}, @key{DEL} and @key{ESC}. The space character is usually |
@key{TAB}, @key{DEL} and @key{ESC}. The space character is usually |
36 |
referred to below as @key{SPC}, even though strictly speaking it is a |
referred to below as @key{SPC}, even though strictly speaking it is a |
37 |
graphic character whose graphic happens to be blank. Some keyboards |
graphic character whose graphic happens to be blank. Some keyboards |
38 |
have a key labeled ``linefeed'' which is an alias for @kbd{C-j}. |
have a key labeled ``linefeed'' which is an alias for @kbd{C-j}. |
39 |
|
|
40 |
Emacs extends the ASCII character set with thousands more printing |
Emacs extends the @acronym{ASCII} character set with thousands more printing |
41 |
characters (@pxref{International}), additional control characters, and a |
characters (@pxref{International}), additional control characters, and a |
42 |
few more modifiers that can be combined with any character. |
few more modifiers that can be combined with any character. |
43 |
|
|
44 |
On ASCII terminals, there are only 32 possible control characters. |
On @acronym{ASCII} terminals, there are only 32 possible control characters. |
45 |
These are the control variants of letters and @samp{@@[]\^_}. In |
These are the control variants of letters and @samp{@@[]\^_}. In |
46 |
addition, the shift key is meaningless with control characters: |
addition, the shift key is meaningless with control characters: |
47 |
@kbd{C-a} and @kbd{C-A} are the same character, and Emacs cannot |
@kbd{C-a} and @kbd{C-A} are the same character, and Emacs cannot |
117 |
programming, but simply want to redefine the meaning of some characters |
programming, but simply want to redefine the meaning of some characters |
118 |
or non-character events, see @ref{Customization}. |
or non-character events, see @ref{Customization}. |
119 |
|
|
120 |
ASCII terminals cannot really send anything to the computer except |
@acronym{ASCII} terminals cannot really send anything to the computer except |
121 |
ASCII characters. These terminals use a sequence of characters to |
@acronym{ASCII} characters. These terminals use a sequence of characters to |
122 |
represent each function key. But that is invisible to the Emacs user, |
represent each function key. But that is invisible to the Emacs user, |
123 |
because the keyboard input routines recognize these special sequences |
because the keyboard input routines recognize these special sequences |
124 |
and convert them to function key events before any other part of Emacs |
and convert them to function key events before any other part of Emacs |
243 |
@cindex characters (in text) |
@cindex characters (in text) |
244 |
|
|
245 |
Text in Emacs buffers is a sequence of 8-bit bytes. Each byte can |
Text in Emacs buffers is a sequence of 8-bit bytes. Each byte can |
246 |
hold a single ASCII character. Both ASCII control characters (octal |
hold a single @acronym{ASCII} character. Both @acronym{ASCII} control characters (octal |
247 |
codes 000 through 037, and 0177) and ASCII printing characters (codes |
codes 000 through 037, and 0177) and @acronym{ASCII} printing characters (codes |
248 |
040 through 0176) are allowed; however, non-ASCII control characters |
040 through 0176) are allowed; however, non-@acronym{ASCII} control characters |
249 |
cannot appear in a buffer. The other modifier flags used in keyboard |
cannot appear in a buffer. The other modifier flags used in keyboard |
250 |
input, such as Meta, are not allowed in buffers either. |
input, such as Meta, are not allowed in buffers either. |
251 |
|
|
252 |
Some ASCII control characters serve special purposes in text, and have |
Some @acronym{ASCII} control characters serve special purposes in text, and have |
253 |
special names. For example, the newline character (octal code 012) is |
special names. For example, the newline character (octal code 012) is |
254 |
used in the buffer to end a line, and the tab character (octal code 011) |
used in the buffer to end a line, and the tab character (octal code 011) |
255 |
is used for indenting to the next tab stop column (normally every 8 |
is used for indenting to the next tab stop column (normally every 8 |
256 |
columns). @xref{Text Display}. |
columns). @xref{Text Display}. |
257 |
|
|
258 |
Non-ASCII printing characters can also appear in buffers. When |
Non-@acronym{ASCII} printing characters can also appear in buffers. When |
259 |
multibyte characters are enabled, you can use any of the non-ASCII |
multibyte characters are enabled, you can use any of the non-@acronym{ASCII} |
260 |
printing characters that Emacs supports. They have character codes |
printing characters that Emacs supports. They have character codes |
261 |
starting at 256, octal 0400, and each one is represented as a sequence |
starting at 256, octal 0400, and each one is represented as a sequence |
262 |
of two or more bytes. @xref{International}. Single-byte characters |
of two or more bytes. @xref{International}. Single-byte characters |
263 |
with codes 128 through 255 can also appear in multibyte buffers. |
with codes 128 through 255 can also appear in multibyte buffers. |
264 |
|
|
265 |
If you disable multibyte characters, then you can use only one |
If you disable multibyte characters, then you can use only one |
266 |
alphabet of non-ASCII characters, but they all fit in one byte. They |
alphabet of non-@acronym{ASCII} characters, but they all fit in one byte. They |
267 |
use codes 0200 through 0377. @xref{Single-Byte Character Support}. |
use codes 0200 through 0377. @xref{Single-Byte Character Support}. |
268 |
|
|
269 |
@ignore |
@ignore |