1

This question is a particular case of this one.

Is there any program that can assign the key combination CTRL+TAB to the gesture RIGHT-CLICK+Mouse-wheel-up/down?

Explanation: I haven't managed to make this exact gesture work with neither compiz nor easystroke as they apparently only allow mouse gestures of the form One-Mouse-Button+CTRL/ALT/Super/Shift, and not One-Mouse-Button+Mouse-Wheel. (Maybe it's actually possible and I haven't found the right box to tick).

Reason: This gesture is very useful for switching through tabs in a web browser. It's possible to use it in Opera (natively), in Firefox (with FireGestures extension) and in Chrome (with crxMouse extension), but I can't get this functionality in other browsers like Tor (doesn't allow extensions).

As most web browsers use the key combination CTRL+TAB to switch to the next tab, it would be ideal assigning the gesture to that key combination GLOBALLY in order to use the gesture no matter the browser I'm using.

Remark: I'm not looking for a partial solution, but a global one. And I'm looking for the exact gesture RIGHT-CLICK+Mouse-wheel-up/down, not another one. I'm sure there must be a way, I mean this is Linux, not iOS.

Thanks in advance.

1

First, install xbindkeys and xautomation...

sudo apt-get update
sudo apt-get install xbindkeys
sudo apt-get install xbindkeys-config
sudo apt-get install xautomation

Understand that configuring these can be difficult, but there are plenty of examples for different .xbindkeysrc online. Here's mine, just to get you started... you'll note that I already have a mouse wheel setup, but it's commented out, as I don't use it...

###########################
# xbindkeys configuration #
###########################
#
# Version: 0.1.3
#
# If you edit this, do not forget to uncomment any lines that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# 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 (on my keyboard): 
#   Control, Shift, Mod1 (Alt), Mod2 (NumLock), 
#   Mod3 (CapsLock), Mod4, Mod5 (Scroll). 
#
# Another way to specifie a key is to use 'xev' and set the 
# keycode with c:nnn or the modifier with m:nnn where nnn is 
# the keycode or the state returned by xev 
#
# This file is created by xbindkey_config 
# The structure is : 
# # Remark 
# "command" 
# m:xxx + c:xxx 
# Shift+... 


#keystate_numlock = enable
#keystate_scrolllock = enable
#keystate_capslock = enable


"xbindkeys_show"
   control + shift + q

#Zoom In
"xte 'keydown Control_L' 'key KP_Add' 'keyup Control_L'"
b:13 + Release

#Zoom Out
"xte 'keydown Control_L' 'key KP_Subtract' 'keyup Control_L'"
b:10 + Release

#Tab Left
#"xte 'keydown Control_L' 'keydown Shift_L' 'key ISO_Left_Tab' 'keyup Control_L' 'keyup Shift_L'"
#b:6 + Release

#Tab Right
#"xte 'keydown Control_L' 'key ISO_Left_Tab' 'keyup Control_L'"
#b:7 + Release

#bind shift + vertical scroll to horizontal scroll events
#(xbindkey '(shift "b:4") "xte 'mouseclick 6'")
#(xbindkey '(shift "b:5") "xte 'mouseclick 7'")

#Horz scroll Left
"xte 'key KP_Right'"
b:6 + Release

#Horz scroll Right
"xte 'key KP_Left'"
b:7 + Release

#
# End of xbindkeys configuration
  • Interesting. I have no access to my computer right now, but I will investigate both programmes and try to get it working. If I get it I will mark this answer with the green tick. Thank you very much. – 100r Nov 27 '16 at 15:42
  • Added this "xte 'keydown Control_L' 'key Tab' 'keyup Control_L'" b:3 + b:4 + Release to the xbindkeysrc file. Not working. I will investigate further. – 100r Nov 29 '16 at 19:45
  • I know it's tricky. Use the xev app to help determine the correct button numbers, etc. Use the keylists at /usr/include/X11/keysym.h and in /usr/include/X11/keysymdef.h The XK_ is not needed. – heynnema Nov 29 '16 at 20:08
  • The button numbers are correct. Can't find a way of telling xbindkeys that I first right-click and then wheel-up. (It works if I press both buttons at the same time) – 100r Nov 30 '16 at 11:30
  • Without having to relearn it myself, I'd recommend searching for xbindkeys or .xbindkeysrc, both here, and Google. You'll find plenty of examples that may help you. – heynnema Nov 30 '16 at 15:24

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.