2

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.

  • Can you edit your question to include your .xbindkeysrc file? – Seth Dec 3 '14 at 22:12
  • @Seth, I've included my .xbindkeysrc file. I understand that 'key Control_L' is left Ctrl. But pressing button 10 on the mouse and, say, the key 'Q' to quit an application doesn't work. I've also tried under key combinations. I'd like to set button 10 to Super + W (Expose). Thank you. – I_am_a_toothbrush Dec 4 '14 at 1:50
  • Sorry for the late reply. Is this "xte 'key Control_L'" b:10 what doesn't work? What do you expect that to do? – Seth Dec 16 '14 at 18:15
  • this tutorial helped me a lot blog.hanschen.org/2009/10/13/mouse-shortcuts-with-xbindkeys – Mohamed Slama Jan 18 '17 at 4:40
  • I 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/… – Andrew Ch Dec 28 '17 at 0:01
2

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:8

"xte 'keyup Control_L'"
    b:8 + Release
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
1

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 #
##################################
0

Must be because the key control by itself does not do much.

Try this:

xte 'keydown Super_L' 'keydown Right' 'keyup Super_L' 'keyup Right'

This is basically Super[windows key]+Right_Arrow that must take any open window to the right half part of your screen.

This is just an example, you can automate any keys combination.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.