为什么键绑定 M-S-t 失败而 C-S-t 有效? [英] Why the key binding M-S-t fails while C-S-t works?

查看:26
本文介绍了为什么键绑定 M-S-t 失败而 C-S-t 有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从这个问题中得到了问题,看来我们不能像 MSt 一样将 shiftmeta 绑定(总是翻译成 Mt),但我们可以使用 control 来做到这一点,比如 CSt(用作 CT).

I got the question from this question, it seems we can't bind shift with meta like M-S-t (always translated to M-t), but we can do it with control like C-S-t (works as C-T).

正如接受的答案所说,我们可以使用 M-T 代替,但为什么我们不能将它与 meta 一起使用?与 meta 一起使用时,Emacs 是否只是忽略 shift?

As the accepted answer said, we can use M-T instead, but why we can't use it with meta? Does Emacs just ignore shift when used with meta?

推荐答案

我认为当不使用 Ctrl 时,Emacs 会忽略 S- 的字母.

I think Emacs ignores S- for letters when Ctrl is not also used.

即它与 Meta 无关;同样的事情适用于其他非 Ctrl 修饰符(实际上没有其他修饰符——你也不能绑定到普通的 S-t).

i.e. it's nothing to do with Meta in particular; the same thing applies to the other non-Ctrl modifiers (and indeed without other modifiers -- you also can't bind to plain S-t).

理由可能是 Ctrl 键是唯一需要字母的显式移位修饰符的情况:

The justification may be that Ctrl keys are the only case where an explicit shift modifier is needed for letters:

(emacs) 修饰键

The default key bindings in Emacs are set up so that modified
alphabetical characters are case-insensitive.  In other words, ‘C-A’
does the same thing as ‘C-a’, and ‘M-A’ does the same thing as ‘M-a’.
This concerns only alphabetical characters, and does not apply to
"shifted" versions of other keys; for instance, ‘C-@’ is not the same as
‘C-2’.

   A <Control>-modified alphabetical character is always considered
case-insensitive: Emacs always treats ‘C-A’ as ‘C-a’, ‘C-B’ as ‘C-b’,
and so forth.  The reason for this is historical.

   For all other modifiers, you can make the modified alphabetical
characters case-sensitive when you customize Emacs.  For instance, you
could make ‘M-a’ and ‘M-A’ run different commands.

我的回忆终端不区分控制字符的大小写,所以我推测历史"原因与此有关.

By my recollection terminals do not distinguish case for control characters, so I would speculate that the "historical" reasons are related to that.

至少在手册中记录这一点是合理的.如果目前不存在相关错误,您可能希望 M-x report-emacs-bug 提出这样的改进建议.

It would be reasonable for this to at least be documented in the manual. You may wish to M-x report-emacs-bug to suggest such an improvement, if no relevant bug exists at present.

请注意,Shift 修饰符可以与非字母键一起使用,可以使用或不使用其他修饰符.M-S-SPC 是一个可识别的序列,例如.

Note that the Shift modifier can be used with non-letter keys, with or without other modifiers. M-S-SPC is a recognised sequence, for example.

这篇关于为什么键绑定 M-S-t 失败而 C-S-t 有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆