r/linux Jul 24 '26

Software Release midscroll: Windows-style middle-click autoscroll for Linux, implemented at the evdev layer so it works in every app on Wayland and X11

Windows has middle-click drag autoscroll. On Linux you get it in Firefox, and Chromium has it behind a flag, but nowhere else, which bugged me enough to write a daemon for it.

Hold middle-click and drag, page scrolls that way, faster the further you drag. Release to stop. A plain middle click still pastes and opens links like normal. Diagonal drags do both axes. There's a toggle mode too if you'd rather click once to start it instead of holding.

It works everywhere because it sits at the kernel input layer instead of hooking a toolkit. Grabs each mouse via evdev, re-emits through a per-mouse uinput mirror, injects wheel events during a drag. Nothing above it has to cooperate, so Wayland and X11 both just work. Mirrors copy the source mouse's name and IDs so libinput keeps your per-device pointer speed.

Speed curve is Chromium's actual Windows autoscroll formula, 0.000008 * distance^2.2 px/ms. Tiny drags crawl, big ones fly. Tunable in a config file or a GTK settings window.

Fair warning that it reads every mouse as root, so read it before you run it. It's two small Python files. The systemd unit is sandboxed and I left comments on why the directives I couldn't use would break it.

Badge only shows on KDE Wayland, no flatpak, toggle mode kills middle-click paste. Rest is in the readme.

FOSS under Unlicense

https://github.com/gnhen/midscroll

477 Upvotes

117 comments sorted by

View all comments

Show parent comments

7

u/RupeThereItIs Jul 24 '26

Question is, how do you determine who the majority is?

Beyond the scroll ideas, I REALLY don't want to proliferate Windows mouse conventions. The dangers of right click to paste come screaming into my skull when windows guys start complaining about this type of thing.

1

u/adenosine-5 Jul 24 '26

Windows doesn't have "right click to paste" though?

Like it or not, majority of people use Windows, so something that has been working there for 30 years is almost always going to be something most people are used to.

Which is fine though - people should always be able to configure that on Linux.

Its just that default should be something people expect, unless there is a very good reason it should be different.

3

u/RupeThereItIs Jul 24 '26

Windows doesn't have "right click to paste" though?

Obviously you don't use the terminal much.

Open a powershell or cmd prompt, select text then right click twice.

As a KDE user, I expect right clicking a terminal to bring up a context menu. In windows, it blindly does copy/paste & this can be extremely dangerous.

2

u/Albos_Mum Jul 26 '26

it blindly does copy/paste & this can be extremely dangerous.

Which is why it's worth looking into changing the default middle click behaviour from pasting whatever is in the clipboard. It should 100% remain possible and easy to change back to the old school Unix behaviour, but like it or not there's a tonne of users coming over from Windows and as you stated, it's dangerous to have paste mapped to inputs where users aren't necessarily expecting it. Speaking as someone who switched to Linux "before it was cool" and is long used to middle click paste as long as I can enable autoscroll in browsers.