-
-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
ploopyco/trackball_mini: always update encoder #18561
Conversation
The encoder derives scroll direction based on the last known wheel position, as such it needs up-to-date wheel state at all times to compute the right direction. When using opt_encoder_simple.c as the implementation, the default delay may cause the encoder to see "impossible" states (which requires recalibration) or states that imply an opposite direction to the actual scrolling direction. This is very evident when the wheel is free-spinning. This commit reorders the code to make sure the optical encoder state is always updated, but only apply scrolling when specified conditions are met (ie. after debounce period, middle mouse released, etc.). Tested with opt_encoder_simple.c, where a free-spinning wheel now generates very smooth scrolling with no apparent glitches. This has not been tested with the default encoder, but similar benefits should be found there.
Technically, should be applied to all of the ploopy devices. |
Thank you for your contribution! |
Description
The encoder derives scroll direction based on the last known wheel position, as such it needs up-to-date wheel state at all times to compute the right direction.
When using
opt_encoder_simple.c
as the implementation, the default delay may cause the encoder to see "impossible" states (which requires recalibration) or states that imply an opposite direction to the actual scrolling direction. This is very evident when the wheel is free-spinning.This commit reorders the code to make sure the optical encoder state is always updated, but only apply scrolling when specified conditions are met (ie. after debounce period, middle mouse released, etc.).
Tested with
opt_encoder_simple.c
, where a free-spinning wheel now generates very smooth scrolling with no apparent glitches. This has not been tested with the default encoder, but similar benefits should be found there.Since all Ploopy devices share the same encoder glue, this change can potentially be replicated to other devices for similar benefits.
Types of Changes
Checklist