如何禁用触控板水平滚动

如何禁用触控板水平滚动

我最近在我老化的笔记本电脑上从 Ubuntu 切换到 Debian+Openbox。极简主义令人耳目一新。

当我用两根手指在触摸板上横向拖动时,这被解释为水平滚动。有什么方法可以禁用此功能吗?

使用xev我已经确定两指水平拖动是按钮 6 和 7。我尝试将此行添加到.Xmodmap

pointer = 1 2 3 5 4

我希望这会隐式取消分配按钮 6 和 7 的水平滚动,但这并没有起作用。

答案1

Debian 9libinput默认情况下应该使用该驱动程序 ( xserver-xorg-input-libinput),因此我将采用该驱动程序的解决方案(请参阅这里)。

/etc/X11/xorg.conf.d/40-libinput.conf创建一个包含以下内容的文件(如果不存在则创建目录):

$ cat /etc/X11/xorg.conf.d/40-libinput.conf
Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "HorizontalScrolling" "false"
EndSection

您可以参考libinput 手册页有关可用配置选项的详细说明。

如果您使用synaptics驱动程序 ( xserver-xorg-input-synaptics),请查看驱动程序的相关页面Debian 维基或者archlinux 维基,解几乎相同。

答案2

鼠标的答案相同

这是禁用水平滚动的示例(保存新文件并重新启动)

纳米 /etc/X11/xorg.conf.d/40-libinput-mouse-left-right.conf

Section "InputClass"
        Identifier "Logitech catchall"
        MatchIsPointer  "on"
        Driver "libinput"
        Option "HorizontalScrolling" "false"
EndSection

其他有用的命令

xinput list
xinput list-props 15

xorg 配置文件也可用于重新映射按钮

Section "InputClass"
    # ...
    Option "ButtonMapping" "1 9 3 4 5 6 7 8 2"
    # OR
    Option "ButtonMapping" "a b c d e f g h i"
    # ...
EndSection

相关内容