emacs - [control shift up] 不起作用 [英] emacs - [control shift up] doesn't work

查看:15
本文介绍了emacs - [control shift up] 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将热键定义如下

(global-set-key [(control shift up)] 'other-window)

但它不起作用(没有错误,只是不起作用),也不起作用

but it doesn't work (no error, just doesn't work), neither does

(global-set-key [(control shift down)] 'other-window)

但是

(global-set-key [(control shift right)] 'other-window) 

(global-set-key [(control shift left)] 'other-window)

工作!

但是因为最后两个组合键是由 emacs 使用的(默认情况下),所以我不想将它们更改为其他功能.

But because the last two key combinations are used by emacs (as default), I don't wanna change them for other functions.

那么我怎样才能使 control-shift-upcontrol-shift-down 工作?

So how could I make control-shift-up and control-shift-down work?

我在谷歌上搜索了(control shift up)",似乎control-shift-up被其他人使用了,(但结果不是很少).

I have googled "(control shift up)", it seems that control-shift-up is used by other people, (but not very few results).

推荐答案

这不是 Emacs 的问题,而是因为你的终端无法产生 C-S-up 的按键序列.

The reason for this is not an Emacs problem, but comes from the fact that your terminal cannot produce a key sequence for C-S-up.

您可以很容易地验证这一点.打开终端,然后输入:

You can verify this very easily. Open a terminal and then type:

Control-v Control-Shift-right

Control-v 部分将使下一个键的控制序列逐字插入到您的 shell 中.在我们的例子中,它将插入 Control-Shift right 的序列,看起来像这样:

The Control-v part will make the control sequence for the next key be inserted verbatim into your shell. In our case, it will insert the sequence for Control-Shift right, and that'll look something like this:

^[[1;6C

现在,为 C-S-up 尝试同样的事情:

Now, try the same thing for C-S-up:

Control-v Control-Shift-up

你会看到没有输入控制序列,这暗示当你在 Emacs 中按下 CS-up 时,它实际上永远不会收到任何东西,因为终端无法产生任何东西传递给 Emacs.

You'll see that no control sequence is entered, which hints at the fact that when you press C-S-up in Emacs, it will actually never receive anything, because the terminal is not able to produce anything to pass on to Emacs.

如果您只是启动一个新的 emacs -nw 并键入 Ch k 来调用 Emacs 的 describe-key,我们可以对此进行双重验证功能.你会被要求在 minibuffer 中输入一个键来查看它绑定到什么函数.如果你现在输入 C-S-up 什么也没有发生 - 当然不会,因为运行 Emacs 的终端不会产生任何东西.

We can double-verify this if you just start a new emacs -nw and type C-h k to invoke Emacs' describe-key function. You'll get asked in the minibuffer to type a key to see what function it is bound to. If you now type C-S-up nothing happens - of course not, since the terminal in which your Emacs runs doesn't produce anything.

但是,如果您只是在寻找未使用的组合键,那么在没有 Control 的情况下仅使用 Shift-up(甚至 Shift-right)怎么样?那个应该可以在终端 emacs 和窗口版本中工作.

However, if you're just looking for an unused key-combination, how about just Shift-up (or even Shift-right) without Control? That one should work both in a terminal emacs and in the windowed version.

这篇关于emacs - [control shift up] 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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