Edge scrolling in Touchpad mode#2478
Conversation
|
Thanks for the upgrade, this is working nicely! |
|
|
||
| int keyboardHeight = currentKeyboard.mBaseHeight; | ||
| int keyboardWidth = currentKeyboard.mBaseWidth; | ||
| int threshold = 50; |
There was a problem hiding this comment.
This is in pixels, right? It would be better to use dp, or maybe some percentage of the keyboard size so behavior is the same for low and high resolution devices.
|
@Helium314 Calculating screen edges based on percentages is a great idea! I’ve implemented this change. I also added acceleration during auto-scrolling:
I initially considered using a linear approach (subtracting a fixed value). I even linked that value to the TOUCHPAD_ACCELERATION_FACTOR used for cursor control, but the exponential acceleration feels much smoother, so I decided to stick with that. |
Summary
Note: I implemented this using KeyboardActionListener.onCustomRequest. I am open to suggestions if there is a more direct or "cleaner" architectural approach to handle haptic feedback.
How it works
Demo
See the attached video demonstrating the auto-scroll functionality
https://github.com/user-attachments/assets/240e3fa3-e3f3-465e-9ce3-a5736af38d54