点击中间按钮无法滚动页面。有没有办法修复这个问题?
信息:
1. Ubuntu 10.10 2. Chromium 9.0.597.94 3. Logitech MX518
更新:还有Chrome和其他基于Chromium的浏览器。
信息:
1. Ubuntu 10.10 2. Chromium 9.0.597.94 3. Logitech MX518
更新:还有Chrome和其他基于Chromium的浏览器。
xinput list
要列出可用的属性,请使用xinput list-props $deviceId
。如果您正在使用libinput(未来/现在),几乎所有属性都将以libinput开头(还要检查libinput list-devices
)。
测试:您始终可以使用libinput debug-events
,xev
,evtest
,evemu-record
或xinput --test $deviceId
来测试输入设备。
libinput
# xinput device option setting
xinput set-prop $deviceId "libinput Scroll Method Enabled" 0, 0, 1 # _button_ as scroll method
xinput set-prop $deviceId "libinput Button Scrolling Button" 2 # Using middle buttpn. Already 2 by default
xinput set-prop $deviceId "libinput Natural Scrolling Enabled" 1 # OPTIONAL, for natural scrolling. You can also get this with gsettings set org.gnome.desktop.peripherals.mouse natural-scroll true
man libinput
的描述:
- libinput滚动方法已启用 3个布尔值(8位,0或1),按顺序为“双指”、“边缘”、“按钮”。表示当前设备上启用的滚动方法。
- libinput按钮滚动按钮 1个32位值。设置用于按钮滚动的按钮编号。此设置与滚动方法无关,要启用按钮滚动,必须将方法设置为按钮滚动,并设置有效的按钮。
evdev
xinput --set-prop $deviceId 'Evdev Wheel Emulation' 1
xinput --set-prop $deviceId 'Evdev Wheel Emulation Button' 2
xinput --set-prop $deviceId 'Evdev Wheel Emulation Axes' 6 7 4 5
evdev
命令中的第一个命令会给我返回*"属性 'Evdev Wheel Emulation' 不存在,您需要指定其类型和格式"*。 - Mark Ameryevdev
运行得非常顺利。只是要注意我的鼠标设备编号是10
而不是11
。 - piepi/usr/share/X11/xorg.conf.d
中设置吗?这样就不需要使用udev脚本了吗? - Arthur Colombini Gusmãoxinput list-props ##
,其中 ##
是从 xinput list
中获取的设备编号。 - CTS_AE在Chrome/Chromium/Electron或任何基于Chromium的应用中使用此标志
--enable-blink-features=MiddleClickAutoscroll
.desktop
文件,并在 Exec=
行的末尾添加此标志(浏览器通常有许多 Exec=
行用于右键操作,主要的在 [Desktop Entry]
下面,但您可能希望对它们都进行更改)。/usr/share/applications/google-chrome.desktop
解释:
在 Linux/Mac 上禁用鼠标中键自动滚动的代码在 这里,基本上是说如果在 Windows 上运行,则启用此闪烁 Runtime Enabled 功能。--{enable,disable}-blink-features
来启用或禁用闪烁运行时启用的功能。
根据此处找到的信息,该功能称为MiddleClickAutoscroll
,因此应为--enable-blink-features=MiddleClickAutoscroll
。
唯一需要注意的是,当您使用此标志时会出现一个警告消息。除此之外,在Chrome/-ium、基于Chromium的浏览器(如Brave)和Electron应用程序(如Discord、Slack等)上都能完美运行。enable-features
和blink-enable-features
标志既不被Chrome/Chromium或您正在使用的其他浏览器推荐,也不受其支持。这就是为什么会显示警告消息,这些选项仅用于测试目的。如果在启用此标志后遇到任何错误,请确保在发送错误报告之前将其禁用。--enable-blink-features=MiddleClickAutoscroll
生效,您需要先关闭所有的Chrome实例。如果您在保持此窗口打开的同时尝试在新窗口中运行其他答案,它将无法工作。在运行此命令之前,请关闭所有Chrome实例!另外值得注意的是,在Ubuntu中,Chrome的可执行文件位于/opt/google/chrome/chrome,因此您应该运行/opt/google/chrome/chrome --enable-blink-features=MiddleClickAutoscroll
。 - Adrian/usr/share/applications/google-chrome.desktop
。 - Adrianabout::flags
时,发现"平滑滚动"选项被启用了。我将其禁用后问题解决了。