utubo / firefox-simple_gesture

🦊An add-on that adds simple touch gestures for Firfox for Android. Sorry, I only check issues sometimes.
https://addons.mozilla.org/ja/firefox/addon/simple-gesture/
Other
29 stars 1 forks source link

Timeout setting improvement #53

Closed byzod closed 5 years ago

byzod commented 5 years ago

The timeout setting is not working as intended.

imo the timeout timer should reset it self if the user's finger is still moving

Thus 1000ms timeout means "if the user's finger stop moving for 1 second, stop gesture detection", and that's how it works in most gesture addons (firegesture, quick gesture, etc)

The current logic is, however, "I gave you 1 second to finish your gesture, no matter the gesture is super simple that you need to wait 800ms after finished it or it's super complex that you can barely draw half of it in 1 second", this is counter-intuitive.

utubo commented 5 years ago

Actually, that's what I am thinking too. But busy at work now, and then modified once enough time. thanks.

utubo commented 5 years ago

I fixed it. (However, if the moving distance is short, it times out.) Thanks for your review !

byzod commented 5 years ago

The timeout timer still need yo adjust trigger condition

As mentioned above, the timeout timer should start from the moment that finger of user stop moving

The timeout timer currently (after the patch), however, is starting when a gesture movement detected. The moment when U-D-R changes to U-D-R-L for example, even when user's finger is still moving.

Per the bug mentioned in #55 and the fact that all gesture scripts are page scripts that only available after the page is ready, the current timeout cause problem:

utubo commented 5 years ago

I know that. But, that has a some problems.

I think I should hack somehow and solve the problem when the page is zoomed rather than fix the timeout. (I don't know if there is a way...)

byzod commented 5 years ago

It's difficult to stop your finger completely until it timeout. So the timeout will not work.

I raise my finger off the screen when gesture finished, I think most user behaves like me? If so then this won't be a problem. If not, then "dead zone" solution may helps: if the user moves very slow for at least x ms, treat it as "stop".

The fix needs to reset the timer every touch-move event.

Event throttling is fine, for example triggering once every 100ms.

solve the problem when the page is zoomed rather than fix the timeout.

But it still won't help with the "laggy" page.

utubo commented 5 years ago

if the user moves very slow

Event throttling is fine, for example triggering once every 100ms.

This can't catch 'L-R' or 'U-D' in100ms. I consider.

But it still won't help with the "laggy" page

I want to do something, but I need to be carefull for all non laggy pages.