manjaro-xfce使用鼠标侧键

1. 安装xbindkeys和xdotool

pacman -S xbindkeys xdotool xorg-xev

2. 找到鼠标侧键键码

xev

点击两个鼠标侧键,输出为:

ButtonPress event, serial 37, synthetic NO, window 0x4600001,
     root 0x16a, subw 0x0, time 2359097, (105,76), root:(816,450),
     state 0x0, button 9, same_screen YES
 ButtonRelease event, serial 37, synthetic NO, window 0x4600001,
     root 0x16a, subw 0x0, time 2359243, (105,76), root:(816,450),
     state 0x0, button 9, same_screen YES
 ButtonPress event, serial 37, synthetic NO, window 0x4600001,
     root 0x16a, subw 0x0, time 2370571, (105,76), root:(816,450),
     state 0x0, button 8, same_screen YES
 ButtonRelease event, serial 37, synthetic NO, window 0x4600001,
     root 0x16a, subw 0x0, time 2370691, (105,76), root:(816,450),
     state 0x0, button 8, same_screen YES

其中,button 9为上键,button 8为下键。

3. 编辑.xbindkeysrc文件

xbindkeys -d > ~/.xbindkeysrc
vim ~/.xbindkeyrc

在文件中加入:

"xdotool key Page_Up"
  b:9
"xdotool key Page_Down"
  b:8

保存退出,测试:

xbindkeys -p

侧键翻页功能生效。

4. 加入自启动

编辑~/.xprofile文件,加入一行:

xbindkeys


https://forum.manjaro.org/t/how-do-i-set-up-extra-mouse-buttons/59291

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.