为什么密钥绑定M-S-t在C-S-t工作时失败? [英] Why the key binding M-S-t fails while C-S-t works?

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

问题描述

我得到了这个问题的问题,似乎我们无法使用 meta 绑定 shift ,如 MSt (始终翻译成 Mt ),但是我们可以使用控件,如 CSt (作为 CT )。



正如接受的答案所说,我们可以使用 MT 而是,为什么我们不能用 meta 使用它?在与 meta 一起使用时,Emacs将忽略 shift

解决方案

我认为,如果不使用Ctrl,Emacs会忽略 S -



ie这与Meta特别无关;同样的事情适用于其他非Ctrl修饰符(实际上没有其他修饰符 - 也不能绑定到简单的 St )。



这个理由可能是Ctrl键是唯一需要使用明确的shift修饰符 的情况:



(emacs)修饰符键

  Emacs中的默认键绑定设置为使修改后的
字母字符不区分大小写。换句话说,C-A
与C-a相同,M-A与M-a相同。
这仅涉及字母字符,不适用于
移位版本的其他键;例如,'C- @'与
'C-2'不同。

A< Control>修改的字母字符始终被视为
不区分大小写:Emacs总是将C-A作为C-A,C-B C-b',
等等。其原因是历史。

对于所有其他修饰符,当您自定义Emacs时,您可以修改字母顺序为
的字符区分大小写。例如,
可以使'M-a'和'M-A'运行不同的命令。

通过我的回忆终端不区分控制字符的情况,所以我会推测历史原因与此相关。



至少在手册中记录这一点是合理的。如果目前没有相关的错误,您可能希望 Mx report-emacs-bug 提出这样的改进。



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


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).

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?

解决方案

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

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).

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

(emacs) Modifier Keys says

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.

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.

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天全站免登陆