-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
Optionally disable smooth scrolling on trackpads #237
Comments
https://codepen.io/ClementRoche/pen/eYbLWLV This needs to be tested on different devices, not only MacOS |
this is a tricky one, i'm using a Logi MX Master 3 mouse on MacOS Sonoma, and the wheel is detected as trackpad.. |
@clementroche This detects my macOS M1 touchpad as a mousewheel - unless I scroll sideways then it detects the track pad. |
I solved it, I think. See here: Just scroll a little bit and it should switch to native scrolling when using Apple's Touchpad. The logic is in this class: Basically I'm searching for the smooth scroll diffs created by Apple's touchpad. So when you enable Lenis, you may disable it after a sample size of a 100 scroll events when it turns out the scroll input is smooth already. |
@philkunz how much scroll is 100 "wheel" events on a trackpad? like one finger swipe? I noticed that scrolling your website using Logitech mouse wheel, it detects a trackpad and disable lenis. Perhaps it requires some fine tuning but it doesn't loook that realiable given the variety of scrolling device on the market. |
Lenis seems to work pretty nicely with a mousewheel, but on MacOS, the native trackpad already has smooth scrolling with acceleration and momentum. Adding Lenis smooth scrolling on top of that makes scrolling feel too loose and unresponsive. There's no official trackpad detection that I know of, but it seems that there are some solutions: https://stackoverflow.com/questions/10744645/detect-touchpad-vs-mouse-in-javascript. I'd love to be able to enable or disable Lenis for trackpads and mousewheels independently.
The text was updated successfully, but these errors were encountered: