Skip to content
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

Add middle mouse button scrolling support #572

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

Xorcist137
Copy link

Description

This PR adds support for middle mouse button scrolling (auto-scrolling) that matches native browser behavior:

Users can click the middle mouse button to enter auto-scroll mode
Moving the mouse controls scroll direction and speed
Any mouse button click or ESC key exits auto-scroll mode
Cursor changes to 'all-scroll' during auto-scrolling to indicate the mode
Simple distance-based scrolling with a small dead zone for precision

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Added events/middle-button.ts with the implementation
Added export in events/index.ts
Added enableMiddleMouseScroll option (default: true) in options.ts
Updated interfaces/scrollbar.ts with the new option type

@sadeghbarati
Copy link
Collaborator

Hi @Xorcist137 Thanks for the PR

Could you please record a video of these changes? 🙏

@Xorcist137
Copy link
Author

brave_NWcxgieh7b.mp4

Hi @sadeghbarati , Thanks for taking a look.
Here's a short video showcasing the functionality.
All it does is replicate the native experience of middle mouse scrolling.
Please let me know if you have any changes you would like to see. I'm interested in contributing however I can.

👌

@sadeghbarati sadeghbarati requested a review from idiotWu March 3, 2025 00:50
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.

2 participants