设置密钥不做任何事情的最佳方法

时间:2018-04-16 09:07:22

标签: emacs mouse key-bindings

我的触控板偶尔会发出[mouse-12]个事件,导致恼人的闪烁和重复的<mouse-12> is undefined消息。

根据elisp惯例,什么是什么都不做?

(global-set-key [mouse-12] 'WHAT-TO-INSERT-HERE?)

1 个答案:

答案 0 :(得分:6)

这将是ignore函数:

ignore is an interactive compiled Lisp function in ‘subr.el’.

It is bound to <mouse-movement>, <bottom-divider> <mouse-1>,
<right-divider> <mouse-1>.

(ignore &rest IGNORE)

Do nothing and return nil.
This function accepts any number of arguments, but ignores them.

如果它对于mouse-movement事件来说已经足够好了,那么触摸板应该足够好了:

(global-set-key [mouse-12] 'ignore)