Emacs 编辑时禁用触摸板与鼠标

2018-10-10  本文已影响36人  wlianfu

第一种方案(推荐)

* 前提: melpa 源
安装 disable-mouse packages
init.el 文件中加入一行
(global-disable-mouse-mode)

第二种方案

(define-minor-mode disable-mouse-mode
  "A minor-mode that disables all mouse keybinds."
  :global t
  :lighter " 🐭"
  :keymap (make-sparse-keymap))

(dolist (type '(mouse down-mouse drag-mouse
                      double-mouse triple-mouse))
  (dolist (prefix '("" C- M- S- M-S- C-M- C-S- C-M-S-))
    ;; Yes, I actually HAD to go up to 7 here.
    (dotimes (n 7)
      (let ((k (format "%s%s-%s" prefix type n)))
        (define-key disable-mouse-mode-map
          (vector (intern k)) #'ignore)))))

(disable-mouse-mode 1)

第三种方案(在 spacemacs 中可用)

(xterm-mouse-mode -1 )
上一篇下一篇

猜你喜欢

热点阅读