Configure Logitech mouse with xbindkeys
Solution 1
I know this questions is a year old, but it still seems to be unanswered.
I think your problem is that you just trigger xte 'key Control_L'
, which will just "tap" your control key, meaning the keypress is only emulated for a very short amount of time and then the key is released. You need to issue a keydown
event when you start pressing the mouse button and fire a keyup
event when you release the mouse button. Your .xbindkeysrc
should look like this:
"xte 'keydown Control_L'"
b:10
"xte 'keyup Control_L'"
b:10 + Release
Solution 2
I found that xte is flakey. My sequence for mapping the the thumb button of my logitech 518 to 'control W' to close tabs and windows never worked well with xte not sequencing properly. For example this failed:
"xte 'keydown Control_L' 'w' 'keyup Control_L'"
b:8
as did this:
"xte 'keydown Control_L' 'w' 'keyup Control_L'"
b:8 + release
I also noticed that xte was slow. I tried xvkbd and it works well.
of course you have to get xvkbd with this:
sudo apt-get install xvkbd
Put this in your .xbindkeysrc
file in your home directory
"xvkbd -text '\C\[w]'"
m:0x0 + b:8
and restart xbindkeys
pkill -f xbindkeys && xbindkeys
Solution 3
I have a Logitech M705 and just went through this.
Button 8 maps to the forward/backward button on the side:
###########################
# xbindkeys configuration #
###########################
# Workspace Left
"xte 'keydown Control_L' 'keydown Alt_L' 'key Left' 'keyup Alt_L' 'keyup Control_L'"
b:8
##################################
# End of xbindkeys configuration #
##################################
Related videos on Youtube
I_am_a_toothbrush
Updated on September 18, 2022Comments
-
I_am_a_toothbrush over 1 year
I have a Logitech Performance MX mouse I want to configure for Ubuntu 14.10 using xbindkeys. I managed to install xbindkeys and xautomation following this post, however, the buttons still don't work.
Here is my xbindkeysrc file:
# For the benefit of emacs users: -*- shell-script -*- ########################### # xbindkeys configuration # ########################### # # Version: 1.8.6 # # If you edit this file, do not forget to uncomment any lines # that you change. # The pound(#) symbol may be used anywhere for comments. # # To specify a key, you can use 'xbindkeys --key' or # 'xbindkeys --multikey' and put one of the two lines in this file. # # The format of a command line is: # "command to start" # associated key # # # A list of keys is in /usr/include/X11/keysym.h and in # /usr/include/X11/keysymdef.h # The XK_ is not needed. # # List of modifier: # Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock), # Mod3 (CapsLock), Mod4, Mod5 (Scroll). # # The release modifier is not a standard X modifier, but you can # use it if you want to catch release events instead of press events # By defaults, xbindkeys does not pay attention with the modifiers # NumLock, CapsLock and ScrollLock. # Uncomment the lines above if you want to pay attention to them. #keystate_numlock = enable #keystate_capslock = enable #keystate_scrolllock= enable # Examples of commands: "xbindkeys_show" control+shift + q # set directly keycode (here control + f with my keyboard) #"xterm" # c:41 + m:0x4 # specify a mouse button #"xterm" # control + b:2 #"xterm -geom 50x20+20+20" # Shift+Mod2+alt + s # ## set directly keycode (here control+alt+mod2 + f with my keyboard) #"xterm" # alt + c:0x29 + m:4 + mod2 # ## Control+Shift+a release event starts rxvt #"rxvt" # release+control+shift + a # ## Control + mouse button 2 release event starts rxvt #"rxvt" # Control + b:2 + Release "xte 'key Control_L'" b:10 ################################## # End of xbindkeys configuration # ##################################
Thanks.
-
web.learner over 9 yearsCan you edit your question to include your
.xbindkeysrc
file? -
web.learner over 9 yearsSorry for the late reply. Is this
"xte 'key Control_L'" b:10
what doesn't work? What do you expect that to do? -
Mohamed Slama over 7 yearsthis tutorial helped me a lot blog.hanschen.org/2009/10/13/mouse-shortcuts-with-xbindkeys
-
Andrew Ch over 6 yearsI can't believe mapping mouse buttons is still an issue in 2017. Don't muck around with xev xte nonsense Why not use Btnx: main daemon Config GUI Install it quick and easy per instructions here: awesomelinux.blogspot.com/2012/08/…
-