Chrome/Chromium middle mouse button for scroll Linux, Mac
In Linux based/Mac systems, Google Chrome / Chromium hasn't got this feature. You have to get AutoScroll extension. Here it is: AutoScroll
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
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.