Mapping mouse events to key presses using xbindkeys
1
vote
1
answer
5934
views
I want to map various mouse actions to key presses using
xbindkeys
. All my attempts to do this in my .xbindkeysrc
file have failed. Attempts have been made using xte
and xdotool
. Below is a summary of what has been tried - although I'd like to map several mouse actions so far I've just been trying to initiate a right-button mouse click.
The following xdotool
and xte
commands work perfectly when called from a terminal, from the graphical pop-up Run Command
text-box, and from within a script called from the terminal and the Run Command
text-box. It is only when called using keys set in the .xbindkeysrc
file that they fail.
Entries from .xbindkeysrc:
"xdotool click 3"
control + 8
"xte 'mouseclick 3'"
control + 7
# -x :0 sets the display.
"xte -x :0 'mouseclick 3'"
control + 6
# Starting a text editor window works fine.
"leafpad"
control + 1
I also had no luck placing the same commands (one at a time) in a script and calling that in .xbindkeysrc
. I added a command at the bottom of the script to create a file - the file gets created every time so I know that the script is being run successfully.
"/full/path/to/mouse/button/script"
control + 5
Please note that there have been no silly mistakes like not restarting xbindkeys
after making alterations, I've been checking that it is running and added a command to .xbindkeysrc
which launches a text editor window so that I can be sure xbindkeys
is running properly.
System Info.
OS: GNU/Linux x86_64
Kernel: 3.13.0-24-generic
Distro: Linux Mint 17 Qiana, Cinnamon 64-bit 2.2.16
[Based On: Ubuntu 14.04.5 LTS, Trusty Tahr]
Asked by mattst
(525 rep)
Nov 15, 2017, 06:08 PM
Last activity: Nov 16, 2017, 03:21 PM
Last activity: Nov 16, 2017, 03:21 PM