I know that there are many questions on the internet about setting keyboard/mouse multimedia keys/buttons in Linux, nevertheless my question is more specific.
My wireless input devices:
The above-mentioned keyboard has i.a.:
- volume up,
- volume down
keys which work fine. My mouse has few multimedia buttons which don't have assigned any actions. I want to assign to two mouse buttons, the same actions, which are assigned to the volume up/down keyboard keys.
When I hold the volume up/down keyboard key down, the volume is gradually getting louder/quieter until volume is maximum/muted. I want the same effect with my mouse.
To fulfill above requirements I followed following steps:
- I installed
xvkbd, which is virtual keyboard for X window system,
- I checked with
xevwhat are the codes of mouse's buttons (
8- volume down,
9- volume up),
I added following lines to
"xvkbd -text '\[XF86AudioLowerVolume]'" b:8 "xvkbd -text '\[XF86AudioRaiseVolume]'" b:9
I brutally 'reloaded'
xbindkeysdaemon (actually I don't know if it can be called daemon because it starts from
pkill -f xbindkeys && xbindkeys
BTW: I don't know how to reload it gracefully.
and it almost works. Now I can turn the volume up/down with mouse buttons but if I keep holding volume up/down button, the volume is not getting gradually louder/quieter. It stops after one 'iteration'. I want 'auto-repeat' as long as I'm holding the button down.
- How can I fix it?
- Is there any other way I can do it? For instance using only
For the sake of completeness:
abc@xyz:~$ xmodmap -pke | grep -i volume keycode 122 = XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume keycode 123 = XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume
- Nice ArchWiki webpage about extra keyboard keys.
keysymsare defined in following header files: