andrewmccalip / doomscroller

Official home of Andrew McCalip's Doomscroller project.
Other
21 stars 3 forks source link

It appears to be accidently clicking #4

Open charlieh0tel opened 4 months ago

charlieh0tel commented 4 months ago

"This is the main bug I've been battling with the v0.1 firmware. It happens mostly on Twitter, where the entire post is clickable. The issue stems from using a single finger click and drag approach. If a scroll event starts and stops within a 40px diameter on the screen, the kernal registers it as a click instead of a scroll. This tends to happen when the wheel is suddenly jolted. It is a balancing act between a long moving average buffer to filter out these transients, and the responsiveness of a short buffer. The ideal fix for this is to implement a two finger HID event. the PC driver doesn't suffer from this issue because its using the enhanced resolution scroll wheel driver of thr Microsoft surface dial."

Just saw this myself.

andrewmccalip commented 4 months ago

One potential short term bandaid is to implement a user selection between the two different modes.

Mode 1 would be touchpad emulation that is smooth scrolling but more click prone.

Mode 2 would be the traditional mouse driver with wheel scroll. This is already implemented in the HID descriptor, it just needs to be called instead of the touchpad mode. This weekend I can add some logic to allow a mode selection, if the accidental clicks are driving you crazy.

hydrox24 commented 4 months ago

implement a user selection between the two different modes.

I would second this. I assume that a traditional mouse driver would also work on laptops/desktops which would add significant functionality.

Notably — though I suspect you're expecting this behaviour — it pairs but does not scroll on MacOS 14 at the moment. It does, however, stop any laptop touchpad presses from working while it is scrolling. Happy to open a second issue on this and help debug once you've got some time!

andrewmccalip commented 4 months ago

I'm traveling at the moment without my laptop, so y'all can try it before I get back.

One easy thing is to turn up the scroll_threshold. This was set fairly low so it started scrolling immediately. This setting serves as a minimum before scroll events are processed.

It's hard to tell exactly what type of event is setting off the errant click. If it's from a sudden spike in movement from vibration, we could implement an acceleration filter. Though this the underlying idea behind using the moving average version of velocity, I'm surprised it's not working better.