Skip to content

Preserve quick middle clicks in toggle mode - #5

Open
oriraz1607 wants to merge 1 commit into
gnhen:mainfrom
oriraz1607:feature/toggle-hold-native-clicks
Open

Preserve quick middle clicks in toggle mode#5
oriraz1607 wants to merge 1 commit into
gnhen:mainfrom
oriraz1607:feature/toggle-hold-native-clicks

Conversation

@oriraz1607

@oriraz1607 oriraz1607 commented Jul 27, 2026

Copy link
Copy Markdown

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_MS setting. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant