Chrome/Chromium middle mouse button for scroll Linux, Mac

Clicking the middle button doesn't allow me scroll the page. Is there any way to fix this behavior?

Information:

  1. Ubuntu 10.10
  2. Chromium 9.0.597.94
  3. Logitech MX518

Update: also Chrome, and the other Chromium based ones.


Solution 1:

In Linux based/Mac systems, Google Chrome / Chromium hasn't got this feature. You have to get an extension, eg.: AutoScroll AutoScroll.

Solution 2:

This will work with all your applications without the need of installing anything.

Get your input deviceId number

xinput list

To list available properties use xinput list-props $deviceId. If you are using libinput (the future/present) almost all properties will start with libinput (also check libinput list-devices).

Test: You can always test your input devices with xev, evtest, xinput --test $deviceId or libinput debug-events.

With libinput

Since 17.04 Ubuntu uses libinput, so to set mouse properties:

xinput set-prop $deviceId "libinput Scroll Method Enabled" 0, 0, 1  # _button_ as scroll method
xinput set-prop $deviceId "libinput Button Scrolling Button" 2      # Using middle buttpn. Already 2 by default

xinput set-prop $deviceId "libinput Natural Scrolling Enabled" 1    # OPTIONAL, for natural scrolling. You can also get this with gsettings set org.gnome.desktop.peripherals.mouse natural-scroll true

Description from man libinput:

  • libinput Scroll Method Enabled 3 boolean values (8 bit, 0 or 1), in order "two-finger", "edge", "button". Indicates which scroll method is currently enabled on this device.
  • libinput Button Scrolling Button 1 32-bit value. Sets the button number to use for button scrolling. This setting is independent of the scroll method, to enable button scrolling the method must be set to button-scrolling and a valid button must be set.

With evdev

xinput --set-prop $deviceId 'Evdev Wheel Emulation' 1
xinput --set-prop $deviceId 'Evdev Wheel Emulation Button' 2
xinput --set-prop $deviceId 'Evdev Wheel Emulation Axes' 6 7 4 5

  • You can add this to a bash script and run it at login.
  • Like wheel, with the same movement while pressing Ctrl will zoom in/out page. Ctrl + 0 to reset.
  • Ubuntu 18.04 use X by default. Probably works also on Wayland.
  • Maybe better than Firefox Autoscrolling, easier to control.
  • Libinput at ArchLinux Wiki

Solution 3:

I recommend another couple of addons, that allows "Scroll a page as if a scrollbar is under your mouse." I found that give us more control over the scroll move.

  • For Firefox
  • For Chromium/Chrome

With both addons you just click and hold secondary button pressed to scroll pages moving the mouse up and down and even horizontally.