Preserve quick middle clicks in toggle mode - #5
Open
oriraz1607 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I use toggle mode, but noticed that it takes over every middle click. That means I can't middle-click links or close browser tabs normally.
This adds a
TOGGLE_HOLD_MSsetting. When it is set above zero, a quick middle-click is passed through normally and holding the button for the configured time starts autoscroll. The default is zero, so existing users keep the current click-to-toggle behavior.I also added the setting to the config file, command line, settings window, and
midscroll-apply. There are tests for quick clicks, held clicks, and the default zero-threshold behavior.I tested it with a 180 ms threshold on Fedora 44 / GNOME 50 using a Logitech G305, and ran
python3 -m unittest discover -s tests -v.This came from my Fedora/GNOME companion project: https://github.com/oriraz1607/midscroll-gnome-indicator. I'm sending the reusable part upstream instead of keeping it only as a local patch. Some of the code was written with OpenAI Codex assistance; I reviewed and tested it before opening this PR.