代码之家  ›  专栏  ›  技术社区  ›  Daniel Vartanov

将密钥设置为不执行任何操作的最佳方法

  •  3
  • Daniel Vartanov  · 技术社区  · 6 年前

    我的触摸板偶尔会出现问题 [mouse-12] 导致恼人的闪烁和重复的事件 <mouse-12> is undefined 消息

    根据elisp惯例,什么是不做事的最佳方式?

    (global-set-key [mouse-12] 'WHAT-TO-INSERT-HERE?)
    
    1 回复  |  直到 6 年前
        1
  •  8
  •   legoscia    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)