【问题标题】:Disabling mouse scrolling in Emacs在 Emacs 中禁用鼠标滚动
【发布时间】:2011-09-11 13:40:56
【问题描述】:

我在互联网上找到的所有信息都告诉我,emacs 默认禁用鼠标滚动,但我的非常热情,当我的拇指离笔记本电脑上的触控板太近时,它会滚动到它的内心深处。我没有允许它这样做,这是我的 .emacs 来证明它:

;; Line by line scrolling                                                                                                                                      
(setq scroll-step 1)

;; Turn off backup file creation                                                                                                                               
;;(setq make-backup-files nil)                                                                                                                                 

;; Enable backup files                                                                                                                                         
(setq make-backup-files t)

;; Save all backup files to this directory                                                                                                                     
(setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/"))))

;; Show column number                                                                                                                                          
(column-number-mode 1)

;; Fix C indenting                                                                                                                                             
(setq c-default-style "bsd"
      c-basic-offset 8)

每隔一段时间,我的拇指就会擦过触控板,突然之间,我会在另一行的中间打字,从我刚才所在的位置向上或向下。我怎样才能阻止这种情况发生?

编辑 运行 M-x customize-option mouse-wheel-mode 会产生:

鼠标滚轮模式:[隐藏值] [切换] 关闭(无)

[状态]:在自定义之外更改;在这里操作可能不可靠。

如果启用了鼠标滚轮模式,则为非零。 [隐藏休息]
见命令mouse-wheel-mode' for a description of this minor mode.
Setting this variable directly does not take effect;
either customize it (see the info node
Easy Customization')
或调用函数“鼠标滚轮模式”。 组:[鼠标]

【问题讨论】:

  • 您使用什么操作系统?你在终端中使用 Emacs 吗?
  • Linux Mint,我将“emacs”别名为“emacs -nw”。
  • 那你确定是 Emacs 滚动而不是你的终端吗?

标签: emacs


【解决方案1】:

默认启用(至少从 Emacs 23 开始)。

要关闭它(本地):

(mouse-wheel-mode -1)

要关闭它(全局):

M-x customize-option mouse-wheel-mode ; set to nil and save

但也许你只是想调整设置:看看 M-x customize-group mouse RET

【讨论】:

  • 令人惊讶的是(鼠标滚轮模式-1)没有解决问题。 ...我不确定你的第二个建议是什么意思。 :(
  • 这会在本地禁用mouse-wheel-mode。要全局禁用它,您必须在鼠标组中自定义 mouse-wheel-mode。我会把它添加到答案中。
  • mouse-wheel-mode 是全局模式,所以第一个应该足够了。
  • 大家好,检查编辑。就 emacs 而言,滚动被禁用。但事实并非如此。
  • 它禁用了鼠标滚轮,但每当触摸鼠标滚轮时它也会不断出错。
【解决方案2】:

我做了以下事情:

;; Disable mouse wheel (and two finger swipe) scrolling because
;; it scrolls horribly and I would rather work without it.

(mouse-wheel-mode -1)

(global-set-key [wheel-up] 'ignore)
(global-set-key [wheel-down] 'ignore)
(global-set-key [double-wheel-up] 'ignore)
(global-set-key [double-wheel-down] 'ignore)
(global-set-key [triple-wheel-up] 'ignore)
(global-set-key [triple-wheel-down] 'ignore)

最后一部分禁用滚轮事件,消除烦人的哔哔声。

【讨论】:

    【解决方案3】:

    这是我禁用所有鼠标滚动(包括水平滚动)的操作:

    (mouse-wheel-mode -1)
    (global-set-key [wheel-up] 'ignore)
    (global-set-key [double-wheel-up] 'ignore)
    (global-set-key [triple-wheel-up] 'ignore)
    (global-set-key [wheel-down] 'ignore)
    (global-set-key [double-wheel-down] 'ignore)
    (global-set-key [triple-wheel-down] 'ignore)
    (global-set-key [wheel-left] 'ignore)
    (global-set-key [double-wheel-left] 'ignore)
    (global-set-key [triple-wheel-left] 'ignore)
    (global-set-key [wheel-right] 'ignore)
    (global-set-key [double-wheel-right] 'ignore)
    (global-set-key [triple-wheel-right] 'ignore)
    

    【讨论】:

      【解决方案4】:

      我认为您看到的不是鼠标滚轮滚动,而是在触控板上点击点击。如果您的鼠标指针指向文档的与您键入的位置不同的部分并且您不小心刷了触控板并且您的触控板/操作系统将其解释为鼠标单击,那么您的输入点将跳转到鼠标光标指向的位置在。

      您可以通过禁用点击点击或使用某些触控板/操作系统的可用功能来解决问题,这些触控板/操作系统会在您键入时一起禁用触控板。你如何做这些将取决于你的触控板/驱动程序/操作系统组合。

      【讨论】:

      • 不,我在 MacBook Pro 上运行 Linux Mint,触控板需要重按才能注册鼠标按钮。
      猜你喜欢
      • 1970-01-01
      • 2011-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-08
      • 1970-01-01
      • 1970-01-01
      • 2023-03-29
      相关资源
      最近更新 更多