Mercurial > emacs
comparison man/faq.texi @ 65032:863e660c91bd
(Swapping keys): Xref for normal-erase-is-backspace-mode, not keyboard-translate.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 18 Aug 2005 15:02:16 +0000 |
parents | f9b024cc4772 |
children | 214cdf9890f7 |
comparison
equal
deleted
inserted
replaced
65031:177b0fcf58b9 | 65032:863e660c91bd |
---|---|
4635 @section How do I swap two keys? | 4635 @section How do I swap two keys? |
4636 @cindex Swapping keys | 4636 @cindex Swapping keys |
4637 @cindex Keys, swapping | 4637 @cindex Keys, swapping |
4638 @cindex @code{keyboard-translate} | 4638 @cindex @code{keyboard-translate} |
4639 | 4639 |
4640 In Emacs 19, you can swap two keys (or key sequences) by using the | 4640 You can swap two keys (or key sequences) by using the |
4641 @code{keyboard-translate} function. For example, to turn @kbd{C-h} into | 4641 @code{keyboard-translate} function. For example, to turn @kbd{C-h} |
4642 @key{DEL} and @key{DEL} to @kbd{C-h}, use | 4642 into @key{DEL} and @key{DEL} to @kbd{C-h}, use |
4643 | 4643 |
4644 @lisp | 4644 @lisp |
4645 (keyboard-translate ?\C-h ?\C-?) ; translate `C-h' to DEL | 4645 (keyboard-translate ?\C-h ?\C-?) ; translate `C-h' to DEL |
4646 (keyboard-translate ?\C-? ?\C-h) ; translate DEL to `C-h'. | 4646 (keyboard-translate ?\C-? ?\C-h) ; translate DEL to `C-h'. |
4647 @end lisp | 4647 @end lisp |
4648 | 4648 |
4649 @noindent | 4649 @noindent |
4650 The first key sequence of the pair after the function identifies what is | 4650 The first key sequence of the pair after the function identifies what is |
4651 produced by the keyboard; the second, what is matched for in the | 4651 produced by the keyboard; the second, what is matched for in the |
4652 keymaps. | 4652 keymaps. |
4653 | |
4654 However, in the specific case of @kbd{C-h} and @key{DEL}, you should | |
4655 toggle @code{normal-erase-is-backspace-mode} instead of calling | |
4656 @code{keyboard-translate}. @inforef{DEL Does Not Delete, DEL Does Not Delete, | |
4657 emacs}. | |
4653 | 4658 |
4654 Keyboard translations are not the same as key bindings in keymaps. | 4659 Keyboard translations are not the same as key bindings in keymaps. |
4655 Emacs contains numerous keymaps that apply in different situations, but | 4660 Emacs contains numerous keymaps that apply in different situations, but |
4656 there is only one set of keyboard translations, and it applies to every | 4661 there is only one set of keyboard translations, and it applies to every |
4657 character that Emacs reads from the terminal. Keyboard translations | 4662 character that Emacs reads from the terminal. Keyboard translations |
4658 take place at the lowest level of input processing; the keys that are | 4663 take place at the lowest level of input processing; the keys that are |
4659 looked up in keymaps contain the characters that result from keyboard | 4664 looked up in keymaps contain the characters that result from keyboard |
4660 translation. | 4665 translation. |
4661 | |
4662 @inforef{Keyboard Translations, Keyboard Translations, emacs}. | |
4663 | 4666 |
4664 @node Producing C-XXX with the keyboard, No Meta key, Swapping keys, Key bindings | 4667 @node Producing C-XXX with the keyboard, No Meta key, Swapping keys, Key bindings |
4665 @section How do I produce C-XXX with my keyboard? | 4668 @section How do I produce C-XXX with my keyboard? |
4666 @cindex Producing control characters | 4669 @cindex Producing control characters |
4667 @cindex Generating control characters | 4670 @cindex Generating control characters |