使用 Ubuntu 看代码的时候,时不时会不小心按到鼠标中键,导致当前文件莫名的被修改。
下面是如何修改鼠标中键为右键的步骤:
ciellee@sh:~/work/SDM660_Android_10$ xinput list | grep 'id='
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ DELL0816:00 044E:120A Touchpad id=13 [slave pointer (2)]
⎜ ↳ Dell KB216 Wired Keyboard id=11 [slave pointer (2)]
⎜ ↳ PixArt Dell MS116 USB Optical Mouse id=17 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Power Button id=8 [slave keyboard (3)]
↳ Sleep Button id=9 [slave keyboard (3)]
↳ Integrated_Webcam_HD: Integrate id=10 [slave keyboard (3)]
↳ Intel HID events id=14 [slave keyboard (3)]
↳ Dell WMI hotkeys id=15 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=16 [slave keyboard (3)]
↳ Dell KB216 Wired Keyboard id=12 [slave keyboard (3)]
ciellee@sh:~/work/SDM660_Android_10$ xinput get-button-map "PixArt Dell MS116 USB Optical Mouse"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
左键1,中键2,右键3
ciellee@sh:~/work/SDM660_Android_10$ xinput set-button-map "PixArt Dell MS116 USB Optical Mouse" 1 3 3
1 3 3 就是修改为 左右右
1 1 3 就是修改为 左左右
但我不 希望用中键。因此修改为 4,命令如下
xinput set-button-map "PixArt Dell MS116 USB Optical Mouse" 1 4 3
希望每次生效的话,修改 ~/.bashrc
在末尾加上:
xinput set-button-map "PixArt Dell MS116 USB Optical Mouse" 1 4 3