-
Notifications
You must be signed in to change notification settings - Fork 33.2k
feat: add middle mouse button scrolling #245882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@microsoft-github-policy-service agree |
I can create more tests but I wanted to get an idea if this was the right way to add middle button scrolling first. I didn't get any response on #6302 (comment) |
This is literally life-saving and I would pay $5 a month for this feature. |
Silly question: does it block text paste on X11 with middle click?
However, the extension is closed source. |
The setting is off by default so it should not prevent paste on middle click but when turned on it will prevent it. This does have two separate modes currently. If the user holds down the middle button and moves the cursor around it will cancel the scrolling on mouse up, and if the user clicks the middle button the scrolling will continue until the middle button is clicked again. Maybe this could be two settings so holding the button will scroll and clicking the button will paste? |
A beautiful attemp after 8 years of waiting!!! HYPPE! |
If the 2 behavior can be implemented, that would be perfect. But for Linux users, it would be a really pain that middle click doesn't paste, so I would much prefer the second solution (scroll on hold) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this PR!
Can you look into the CI failure?
I will be out for the next 2 weeks, so we might not be able to take it before the May release.
src/vs/editor/contrib/middleScroll/browser/images/all-scroll.png
Outdated
Show resolved
Hide resolved
It looks like the tests are failing because Is there something different I need to do in the tests to get |
@Glandos could you test this with linux and paste on middle click? I don't have a linux setup to test. Is paste on middle click on mousedown or mouseclick? |
I'm sorry to ask a silly question: how do you test this? Is there a CI job that build a version for each PR? |
We're still waiting for this amazing feature, 8y later! |
I was able to setup a linux vm and test this with paste on middle click. What I have found is that scroll on middle button and paste on middle click cannot be used together because scroll on middle button requires a mouse down events. Knowing before the mouse down event which one the user intends is not likely possible. Possible solutions:
@hediet thoughts? |
The current situation is that we have 3 settings that can determine what happens on middle button click:
I think it would be good to change it to one setting that is a dropdown but that can be done after this PR |
Thanks for testing on linux!
I refactored the code change in the mouse dispatching logic a bit (shouldn't change anything though), to go from one special case with a special case exclusion to two special cases. I'm not very familiar with the middle mouse button pasting mechanism on linux, but if this only gets a problem if the user turns on two middle mouse button features, it is okay that they conflict (and one of them does not work). I was on vacation again and I think this needs a little more polishing and testing, so let's try to merge it early next iteration (i.e. next week)! |
We can put the listeners on whatever element we want but the user will have to mouse up/down/move on that element in order to affect the scrolling. In other words, if we put the listeners only on the editor and someone clicks the middle button to start scrolling they can only stop scrolling by clicking the editor again. If they click or mouse up outside of the editor it won't stop scrolling. |
@hediet anything else we need to do to merge this? |
I noticed some more problematic things, so I introduced observables in your implementation. I think we can merge it now!
However, I didn't figure out a quick way to write tests for this new implementation. Thanks for the PR again! Are you up to write release notes for your feature and provide some testing steps or test the feature yourself? :) |
One thing I noticed in testing is that your changes removed the scroll on click and only left the scroll on holding the middle mouse button down. I think that is a good start, but I know from adding this to Atom that a lot of people prefer clicking the middle button then moving the mouse then clicking again to end scrolling. |
Good point, missed that! Fixed in #251393. |
Can we have this scroll-lock behaviour optional, please? Scroll lock is particularly annoying for left-handed people, like me, who accidentally hit the middle mouse button frequently. For reference, see this Bugzilla issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1923233 |
If there is enough demand, I'm up to add a setting for this (default with scroll lock though, as at least chrome also works like that). |
Thanks for considering my concerns. Feature request created: #251609 |
Add middle mouse button scrolling
fixes #6302