How to Enable Horizontal Scrolling With a 3-Button Mouse

You may have a 3 buttons mouse with vertical scroll, but no physical horizontal scroll.

Here is how to have horizontal scroll emulation using SHIFT + vertical scroll.

Installation

First install those two packages from source:

Configuration

Vertical scrolling is seen as two buttons by X, by default it's button 4 and 5. (1 is left, 2 is right, 3 is middle) Horizontal scrolling is also seen as two __buttons', 6 and 7 by default.

So the idea is, for each SHIFT + button 4, a button 6 event should be generated. The same for button 5 and 7.

Create the file ~/.xbindkeysrc.scm with the following content:

Then create the file ~/.config/autostart/xbindkeys.desktop with the following content:

This will run xbindkeys on every desktop login. You can run xbindkeys directly to have it work right now.

Firefox

For this to work in Firefox too, you have to disable the action bound to shift+scroll which do back and forward action per default.

Go to about:config, search the key mousewheel.with_shift.action and assign it the value -1.