question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Limit mouse wheel scroll speed

See original GitHub issue

Is it possible to limit or throttle how fast the scroll wheel scroll is able to move? If I flick my scroll wheel, it scrolls as fast is my mouse emits events. I would like to limit it at a maximum speed, similar to how you can clamp the speed on the mouseEdges plugin.

Here is my current viewport configuration:

const viewport = new Viewport({
  interaction: app.renderer.plugins.interaction,
  disableOnContextMenu: true,
});

viewport.drag({ mouseButtons: 'right' });
viewport.decelerate({ friction: 0.975 });
viewport.mouseEdges({ distance: 5, speed: 12, decelerate: false });

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
davidfigcommented, Apr 27, 2021

Ah, I understand. I’m not sure it makes sense as an option on the drag plugin, however.

The fastest way to do this is to create a user plugin based on drag() and change the wheel function. In that function you want to track speed (number of turns / second) and if it’s greater than a maximum speed setting, then don’t perform the scroll. Let me know if you have any questions about implementation.

0reactions
jakecommented, Apr 27, 2021

Because I am attaching a network event to scrolling. I am building a UI similar to google maps (except the mouse wheel scrolls instead of zooms). As you pan around I download new data, so I wanted to limit the speed you can move at.

TBH not sure how annoying it will feel… was hoping to implement something to see 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change Mouse Scroll Speed in Windows 11/10
Change Mouse Scroll Speed in Windows 11 · Open Settings · Open Bluetooth and Device settings · Click on Additional mouse settings ·...
Read more >
Mouse Scroll Too Slow or Fast? How to Fix It in Windows 10
Click Additional mouse options. · Click the Wheel tab. · In the Horizontal Scrolling section, enter your desired scroll rate. · Click OK....
Read more >
Change Mouse Scroll Speed in Windows 10 - Winaero
Open the Settings app. · Go to Devices -> Mouse. · On the right, select Multiple lines at a time under Roll the...
Read more >
How to Configure Mouse Wheel Speed Across Browsers ...
The mouse wheel's scrolling speed varies with the choice of the web browser, even the DOM events and methods to change the scrolling...
Read more >
Can I change the scroll speed using css or jQuery?
In the example below, I would like to reduce the scroll speed of the div's content, especially when using the mouse wheel, as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found