我使用的是 ubuntu 22.04 LTS,即使按照其他帖子的建议尝试了 imwheel -b "45" 命令,拇指按钮仍然无法被检测到,这一直存在问题。现在我有一个 mousewheel.sh 文件,如下所示:
### see if imwheel config exists, if not create it ###
if [ ! -f ~/.imwheelrc ]
then
cat >~/.imwheelrc<<EOF
".*"
None, Up, Button4, 4
None, Down, Button5, 4
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
这是 .imwheelrc:
".*"
None, Up, Button4, 5
None, Down, Button5, 5
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L, Up, Shift_L|Button4
Shift_L, Down, Shift_L|Button5
我尝试运行 imwheel -d --debug --kill,奇怪的是,这是唯一检测到我的鼠标拇指按钮的地方,但它们分别打印出“[”和“]”。有人能帮我弄清楚如何让我的鼠标按钮工作吗,因为我刚接触 Linux,现在有点迷茫。提前谢谢!
答案1
您需要为所有应用程序启用后退/前进拇指按钮:
None, Thumb1, Alt_L|Left
None, Thumb2, Alt_L|Right
因此,请清理 .imwheelrc 文件并将以下配置添加到此文件:
".*"
None, Up, Button4, 3
None, Down, Button5, 3
None, Thumb1, Alt_L|Left
None, Thumb2, Alt_L|Right
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L, Up, Shift_L|Button4
Shift_L, Down, Shift_L|Button5
您将能够使用这些鼠标操作输入:向上、向下、向左、向右、拇指
它将解决你的问题。