设置密钥的最佳方法是什么都不做

Dan*_*nov 3 emacs mouse key-bindings

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

根据elisp约定,什么都不做的最佳方法是什么?

(global-set-key [mouse-12] 'WHAT-TO-INSERT-HERE?)
Run Code Online (Sandbox Code Playgroud)

leg*_*cia 7

那就是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.
Run Code Online (Sandbox Code Playgroud)

如果对mouse-movement事件足够好,那么对于触摸板也应该足够好:

(global-set-key [mouse-12] 'ignore)
Run Code Online (Sandbox Code Playgroud)