Emacs可以区分ctrl-r和ctrl-shift-r吗? [英] Can Emacs differentiate between ctrl-r and ctrl-shift-r?
问题描述
我想将 Ctrl + R 绑定到'isearch-backward
并绑定 Ctrl + Shift + R 到'tags-apropos
但是我无法区分两个键
可以emacs区分 Ctrl + R 和 Ctrl + Shift + R ?什么应该进入我的.emacs文件以允许这个键盘绑定?
是的。
pre>
(global-set-key(kbdCr)'isearch-backward)
(global-set-key(kbdCSr)' apropos)
找出这种问题的答案的方法是在键上做一个帮助 Ch k ,并键入您感兴趣的按键。Emacs在帮助缓冲区中显示的是您可以传递给宏的字符串 kbd
。
I'd like to bind Ctrl + R to 'isearch-backward
and bind Ctrl + Shift + R to 'tags-apropos
but I can't distinguish between the two key presses.
Can emacs differentiate between Ctrl + R and Ctrl + Shift + R? What should go into my .emacs file to allow this keybinding?
Yes.
(global-set-key (kbd "C-r") 'isearch-backward)
(global-set-key (kbd "C-S-r") 'tags-apropos)
The way to figure out the answer to this kind of question is to do help on a key C-h k, and type the keystrokes you're interested in. What Emacs shows in the Help buffer is the string you can pass to the macro 'kbd
.
这篇关于Emacs可以区分ctrl-r和ctrl-shift-r吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!