4637 |
@cindex Keys, swapping |
@cindex Keys, swapping |
4638 |
@cindex @code{keyboard-translate} |
@cindex @code{keyboard-translate} |
4639 |
|
|
4640 |
In Emacs 19, you can swap two keys (or key sequences) by using the |
You can swap two keys (or key sequences) by using the |
4641 |
@code{keyboard-translate} function. For example, to turn @kbd{C-h} into |
@code{keyboard-translate} function. For example, to turn @kbd{C-h} |
4642 |
@key{DEL} and @key{DEL} to @kbd{C-h}, use |
into @key{DEL} and @key{DEL} to @kbd{C-h}, use |
4643 |
|
|
4644 |
@lisp |
@lisp |
4645 |
(keyboard-translate ?\C-h ?\C-?) ; translate `C-h' to DEL |
(keyboard-translate ?\C-h ?\C-?) ; translate `C-h' to DEL |
4651 |
produced by the keyboard; the second, what is matched for in the |
produced by the keyboard; the second, what is matched for in the |
4652 |
keymaps. |
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}. |
4658 |
|
|
4659 |
Keyboard translations are not the same as key bindings in keymaps. |
Keyboard translations are not the same as key bindings in keymaps. |
4660 |
Emacs contains numerous keymaps that apply in different situations, but |
Emacs contains numerous keymaps that apply in different situations, but |
4661 |
there is only one set of keyboard translations, and it applies to every |
there is only one set of keyboard translations, and it applies to every |
4664 |
looked up in keymaps contain the characters that result from keyboard |
looked up in keymaps contain the characters that result from keyboard |
4665 |
translation. |
translation. |
4666 |
|
|
|
@inforef{Keyboard Translations, Keyboard Translations, emacs}. |
|
|
|
|
4667 |
@node Producing C-XXX with the keyboard, No Meta key, Swapping keys, Key bindings |
@node Producing C-XXX with the keyboard, No Meta key, Swapping keys, Key bindings |
4668 |
@section How do I produce C-XXX with my keyboard? |
@section How do I produce C-XXX with my keyboard? |
4669 |
@cindex Producing control characters |
@cindex Producing control characters |