罗技 MX Revolution
本文展示了如何配置罗技 MX Revolution 鼠标。
安装
配置
Xorg
Xorg 能够自动检测到这款鼠标。但是,它有 17 个按键映射。
编辑 /etc/X11/xorg.conf
的鼠标配置段落
Section "InputDevice" Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/input/mice" Option "ZAxisMapping" "4 5" #Option "XAxisMapping" "6 7" #uncomment if you want horizontal scrolling with mouse wheel Option "Buttons" "17" EndSection
使用 Xbindkeys 绑定鼠标按键
我们会将所有设置放入 ~/.xbindkeysrc
,Xbindkeys 的配置文件中。
你可能需要在 ~/.xbindkeysrc
中放入发送到 xvkbd 的事件。这是一个示例
"/usr/bin/xvkbd -text "\[Alt_L]\[Left]"" m:0x0 + b:8 "/usr/bin/xvkbd -text "\[Alt_L]\[Right]"" m:0x0 + b:9 "/usr/bin/xvkbd -text "\[Control_L]\[Page_Up]"" m:0x0 + b:6 "/usr/bin/xvkbd -text "\[Control_L]\[Page_Down]"" m:0x0 + b:7
由于某些原因,某些键盘事件组合拒绝与我的某些按钮一起工作。
m:0x0
指的是你的第一只鼠标。“+b:8”指的是你按下的按钮。这是一个所有按钮的列表
# Mappings for keys for MX Revo # b:1 - left mouse button # b:2 - left and right mouse button together # b:3 - right mouse button # b:4 - mouse wheel up # b:5 - mouse wheel down # b:6 - mouse wheel left # b:7 - mouse wheel right # b:8 - back button # b:9 - forward button # b:10 - -none- # b:11 - -none- # b:12 - -none- # b:13 - media wheel up # b:14 - -none- # b:15 - media wheel down # b:16 - -none- # b:17 - media wheel press
要重新映射搜索按钮的功能,而不是搜索,请将类似以下内容放入 ~/.xbindkeysrc
。
这里的示例是将其重新映射为 Alt+F4
以关闭窗口。
"/usr/bin/xvkbd -text "\[Alt_L]\[F4]"" c:0xE1
或者,Gnome 会将小的中间搜索按钮识别为键盘事件。因此,你只需进入键盘快捷键并将其重新映射到其他功能。这可能是使用此按键最可靠的方法。
使用 Xmodmap 绑定鼠标按键
可以使用 xmodmap 将按钮按下注册为中键单击。首先将按键事件分配给 Pointer_Button 2。
echo "keycode 225 = Pointer_Button2" >> ~/.Xmodmap
现在,你可以创建一个启动脚本,将该输入馈送到 xmodmap 中,并自动启动它。
#!/bin/sh xmodmap ~/.Xmodmap
并且不要忘记使其可执行。
这个技巧仅在“mousekeys”开启时有效。因此,要么 gnome-keyboard-properties -> 鼠标键 -> 启用指针,要么使用 SHIFT-ALT-NUMLOCK 切换(你可能希望能够切换,以便有时可以使用数字键盘)。或者在 KDE 系统设置 -> 键盘和鼠标 -> 鼠标 -> 鼠标导航 -> 选中“使用键盘移动指针(使用数字键盘)”
最后,将 xbindkeys 添加到你的启动项,你应该一切就绪了。
将搜索按钮映射到中键单击的最佳方法是将以下行添加到 /etc/sysctl.d/50-mouse.conf
# Enable mouse button emulation dev.mac_hid.mouse_button_emulation = 1 # Set 2nd button to 217 - the middle button of MX Revolution mouse. dev.mac_hid.mouse_button2_keycode = 217 # Optionally reset default mapping of Alt_R to right click # by mapping right click to a non-existing key dev/mac_hid/mouse_button3_keycode = 999
鼠标滚轮模式
为了启用或禁用鼠标滚轮的自由滚动模式,你可以使用 revoco2AUR。从 shell 给出以下命令,或者将其放入启动时执行的脚本中,应该可以启用/禁用自由滚动。
# revoco free # in order to enable free spinning # revoco click # in order to disable free spinning
也可以重新映射按钮以在自由滚动和点击滚动之间切换。
# revoco manual 6 # use search button instead of middle click.
这将释放滚轮按钮,使其可以充当普通鼠标 3 按钮。
更多信息可以在 这里 找到