目前,如果我按 C-h c
,然后按三次 ESC
键盘上的键我得到结果
ESC ESC ESC (translated from <escape> <escape> <escape>) runs the command keyboard-escape-quit
ESC
和有什么区别和 <escape>
以及如何使用这种差异来进行更多的键绑定(bind)?
最佳答案
在 emacs
中找到解决方案mailing list archive :
The escape key usually is linked to the escape char, but the two are different. Under a tty, Emacs receives the exact same byte-sequence from the terminal if you type the escape key or if you type C-[ (both send the escape char).
Under a GUI, on the other hand, Emacs can distinguish the two, so under a GUI, the escape key doesn't send
?\e
(akaESC
for kbd) butescape
(aka<escape>
for kbd) which is usually turned into a?\e
via function-key-map (i.e. only if there's no corresponding binding for the key sequence withescape
).Same thing happens with tab (i.e. TAB (aka
C-i
) vs tab) and return (i.e. RET (akaC-m
) vs return).
关于Emacs 转义键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16677825/