Ubuntu下Logi MX Ergo自定义按键
由于罗技官网并没有提供Ergo在Ubuntu下的option,如果想使用鼠标上的自定义按键,就需要自己配置一下。
1. 安装所需支持包
apt-get install xvkbd
apt-get install xbindkeys
apt-get install xbindkeys-config #这个是图像化界面,可以不安装
2. 配置xbindkeys
首先,查看Ergo的键值
1. 执行xinput list
,输出如下:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ USB Keyboard Consumer Control id=11 [slave pointer (2)]
⎜ ↳ Full Speed Keyboard Consumer Control id=17 [slave pointer (2)]
⎜ ↳ Logitech MX Ergo id=19 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=22 [slave pointer (2)]
这个鼠标的ID Logitech MX Ergo id=19
,ID = 19
2. 执行xinput test 19
来测试键值:
button press 9
button release 9
button press 8
button release 8
经过测试,得到各个键值如下:
修改xbinkeys配置文件:
vim /root/.xbindkeysrc
添加:
# Button 8 sends PageDown
"xvkbd -text '\[Next]'"
b:8
# Button 9 sends PageUp
"xvkbd -text '\[Prior]'"
b:9
这几行语句实现键8,9快速滚动页面的功能
保存并退出
如果不知道相应的快捷键,可以使用
xbindkeys --key
这个语句查看,输出如下:root@user:~# xbindkeys --key Press combination of keys or/and click under the window. You can use one of the two lines after "NoCommand" in $HOME/.xbindkeysrc to bind a key. "(Scheme function)" m:0x0 + c:112 Prior```
3. 输入xbindkeys
指令执行键值修改
root@user:~# xbindkeys
root@user:~#
4. 完成!
撤销修改
执行xbinkeys-config
出现GUI界面,按default恢复缺省值
参考:Bind Mouse Buttons to Keys or Scripts under Linux with xbindkeys and xvkbd