我使用的是Microsoft Wireless Mouse 5000,桌面版。
目前使用的输入驱动系统无法更改鼠标滚动速度,至少没有不良影响。您可以通过KDE设置来调整Qt应用程序的滚动速度,但当前通用方式改变滚动速度的唯一方法是使用imwheel
,但这种方法在很多方面存在问题(请参见评论)。未来,这将通过libinput
和systemd硬件数据库来修复。
使用以下命令安装imwheel
或者从软件中心安装:
$ sudo apt-get install imwheel
使用您选择的编辑器(例如gedit
),创建(如果必要)并编辑配置文件~/.imwheelrc
。填写以下内容以增加每个命令的滚动速度。注意:此配置文件将将这些新的滚动设置应用于所有程序(包括终端,这可能不是您想要的)。
".*"
None, Up, Up, 3
None, Down, Down, 3
".*-chrome*"
None, Up, Up, 3
None, Down, Down, 3
$ man imwheel
imwheel
:$ imwheel
$ killall imwheel
imwheel
在计算机启动时自动运行,你必须在加载x窗口后将其添加到启动菜单中。重要提示:由于imwheel依赖于已经运行的x窗口,如果将其添加到crontab、/etc/init.d或/etc/rc.local中,它将无法工作。这意味着你必须按照以下方式进行操作:imwheel
添加为启动程序:https://askubuntu.com/a/48327/327339
Xubuntu:imwheel
作为启动程序添加进去。
更多屏幕截图请参见:https://askubuntu.com/a/369443/327339。
本教程目前正在开发中。
libinput
似乎已包含在Wily Werewolf (15.10)版本中,您需要安装xserver-xorg-input-libinput
软件包。安装完libinput
后,您可以使用以下命令:
$ sudo apt-get install xserver-xorg-input-libinput
在重新启动Xorg(注销即可)之后,应该对每个输入都使用它。现在你正在使用libinput
,你可以调整鼠标的设置。你可以在文件/lib/udev/hwdb.d/70-mouse.hwdb中找到完整的教程。我在这里只介绍基础知识。
以下步骤需要以root
身份执行。因此,我友情提醒你,你所做的一切都需要负责任。
首先使用lsusb
获取厂商ID <vid>
和产品ID <pid>
。以MX 518罗技鼠标为例。如果在lsusb
的输出中有以下行:
Bus 005 Device 002: ID 046d:c051 Logitech, Inc. G3 (MX518) Optical Mouse
<vid>
是 046d
,而 <pid>
是 c051
。gksudo gedit /etc/udev/hwdb.d/71-mouse-local.hwdb
命令创建一个类似下面的文件。mouse:usb:v<vid>p<pid>:name:*:
MOUSE_WHEEL_CLICK_ANGLE=??
mouse:usb:v046dpc051:name:*:
MOUSE_WHEEL_CLICK_ANGLE=30
udevadm hwdb --update
udevadm trigger /dev/input/event${id}
xinput
(注意鼠标的id),可以找出${id}
,然后运行xinput list-props ${xinput_id}
。imwheel
会禁用在Unity启动器上通过鼠标滚动图标来切换窗口的功能。 - Rodrigo Oliveira".*"
替换成 "Evince"
(如果你使用的是 Evince)。这样 Unity-Launcher 就会按预期工作。 - tvnlibinput
,但无法使更改生效。我使用的是elementary 0.4版本,但我想16.04的说法意味着libinput并没有像我们想象的那样实施。 - Wolf".*-chrome"
的窗口。 - Frank NFuture
解决方案了吗?我尝试过,但是没有使其工作。我希望知道是否成功更改了MOUSE_WHEEL_CLICK_ANGLE
的方法,但是我不知道如何检查它的当前值。默认角度因鼠标而异,可以在/usr/lib/udev/hwdb.d/70-mouse.hwdb
中看到,目前大多数鼠标的角度为15。 - miyalys".*-chrome.*"
? - Frank Nlibinput debug-events
应该显示滚动和其他指针事件,这样你至少可以看到数字是否根据你的自定义配置发生了变化。 - Jani Uusitalo/lib/udev/hwdb.d/70-mouse.hwdb
。 - sjasimwheel
似乎在x11和Wayland窗口管理器中都能很好地与Chrome配合使用,但它只能在x11中与其他程序(如Sublime Text)一起工作!在Wayland中无法正常工作。有什么想法或者如何修复这个问题吗? - Gabriel Staples~/.imwheelrc
并不能真正增加滚轮速度。相反,它将滚动替换为多次箭头键操作。这样做的缺点是在您切换焦点之前无法滚动窗口,而这不是默认行为。本答案旨在提供一个更接近原生行为的替代方案。imwheel
并按照以下步骤进行配置以实际增加滚轮速度:
通过运行以下命令安装 imwheel
:
sudo apt install imwheel
(根据您的系统,将 apt
替换为 apt-get
)
编辑 ~/.imwheelrc
文件:
gedit ~/.imwheelrc
并粘贴以下内容:
".*"
None, Up, Button4, 3
None, Down, Button5, 3
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L, Up, Shift_L|Button4
Shift_L, Down, Shift_L|Button5
您可以尝试不同的数值替换以下行中的 #
:
None, Up, Button4, #
None, Down, Button5, #
使用以下命令测试设置:
killall imwheel && imwheel -b "4 5"
打开“启动应用程序”并添加:
imwheel -b "4 5"
请注意,使用选项 -b "4 5"
限制了 imwheel
只影响滚轮,详细讨论请参考 here。
#
的位置尝试较小的值吗?比如2
、1
,甚至是一个小数值,例如0.5
? - Steven C. Howell2
这个解决方案效果最好。 - Wolf// 编辑
由于这个帖子偶尔会得到一些赞扬: 我不再使用它(重新安装后的懒惰),而且我现在认为这个脚本的滑块和其他东西太过繁琐。此外,人们随着时间的推移已经指出了一些问题。所以作为一个极简主义者,我现在自己创建了配置。对于大多数人来说,这可能只是一次性的事情。
我已经编辑了这个,让它成为一个包含所有你需要的四步指南。
另一个更新:由于我切换到 KDE,它实际上有一个针对此设置和数百万其他 Gnome 不具备的功能的设置(甚至没有意识到我多么想念 KDE)。问题是 KDE 的鼠标设置实际上对 Firefox(以及我认为的其他 GTK 应用程序)没有任何效果,但由于我使用它主要是为了网页浏览,我现在发现你实际上可以调整 Firefox 中鼠标滚动的速度。
about:config
mousewheel.default.delta_multiplier_y
我将其设置为600,对我来说很完美
// 编辑结束
被接受的答案有一个配置,出于某种原因将滚动映射到键盘上的上下方向。对我来说没有意义。
我找到了一个完美的脚本,实际上将其映射到鼠标,并添加了一个GUI来设置鼠标速度。
#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
#
### see if imwheel config exists, if not create it ###
if [ ! -f ~/.imwheelrc ]
then
cat >~/.imwheelrc<<EOF
".*"
None, Up, Button4, 1
None, Down, Button5, 1
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L, Up, Shift_L|Button4
Shift_L, Down, Shift_L|Button5
EOF
fi
##########################################################
CURRENT_VALUE=$(awk -F 'Button4,' '{print $2}' ~/.imwheelrc)
NEW_VALUE=$(zenity --scale --window-icon=info --ok-label=Apply --title="Wheelies" --text "Mouse wheel speed:" --min-value=1 --max-value=100 --value="$CURRENT_VALUE" --step 1)
if [ "$NEW_VALUE" == "" ];
then exit 0
fi
sed -i "s/\($TARGET_KEY *Button4, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button4, and write new value.
sed -i "s/\($TARGET_KEY *Button5, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button5, and write new value.
cat ~/.imwheelrc
imwheel -kill
sudo apt-get install -y imwheel
wget http://www.nicknorton.net/mousewheel.sh ~/bin/set-mousewheel
chmod +x ~/bin/set-mousewheel
~/bin/set-mousewheel
set-mousewheel
命令进行更改。zenity --scale --window-icon=info --ok-label=Apply --title="Wheelies" --text "Mouse wheel speed:" --min-value=1 --max-value=100 --value="$CURRENT_VALUE" --step 1
返回错误:
此选项不可用。请参阅--help以获取所有可能的用法。
- Mobigitalimwheel
建议有所帮助,但我发现移除机械滚轮点击机制使得我的鼠标滚轮使用起来更加愉快 - 不仅消除了点击声音,还使其控制起来更加快速和精确!http://www.instructables.com/id/Making-a-mouse-wheel-not-click./
简而言之,你要移除这个左弹簧(请小心确保将正确的弹簧放回原位): 注意:我有一只标准的廉价鼠标 - Logitech B100,其他人报告在类似型号上取得了成功。你的情况可能会有所不同。# get the tool
git clone https://github.com/albertz/mouse-scroll-wheel-acceleration-userspace.git
cd mouse-scroll-wheel-acceleration-userspace
# install Python dependencies
sudo apt install python3-pip
pip3 install --user -r requirements.txt # (basically pynput)
# run the tool
./main.py -v --exp 1 # example flags. see --help
# (leave this running in background)
imwheel
在除了Chrome之外的程序中工作有问题一样,比如在Sublime Text中(我会在这里简要描述),这个工具也不能在除了Chrome之外的程序中工作,比如在Sublime Text中。 - Gabriel Staples#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
#
### see if imwheel config exists, if not create it ###
if [ ! -f ~/.imwheelrc ]
then
cat >~/.imwheelrc<<EOF
".*"
None, Up, Button4, 1
None, Down, Button5, 1
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L, Up, Shift_L|Button4, 1
Shift_L, Down, Shift_L|Button5, 1
EOF
fi
##########################################################
CURRENT_VALUE=$(awk -F '[|]Button4,' '{print $2}' ~/.imwheelrc)
NEW_VALUE=$(zenity --scale --window-icon=info --ok-label=Apply --title="Wheelies" --text "Mouse wheel speed:" --min-value=1 --max-value=100 --value="$CURRENT_VALUE" --step 1)
if [ "$NEW_VALUE" == "" ];
then exit 0
fi
sed -i "s/\($TARGET_KEY *Button4, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button4, and write new value.
sed -i "s/\($TARGET_KEY *Button5, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button5, and write new value.
cat ~/.imwheelrc
killall imwheel ;
imwheel
imwheel -kill -b "4 5"