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
Disabled touch input: always active gestures #10624
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not familiar with Dispatcher/Gestures, but this looks sound ;).
That's more of a potential backend issue for potential future fancy widgets with funky gesture handling, the codebase still matches that assessment right now ;). |
plugins/gestures.koplugin/main.lua
Outdated
@@ -134,7 +134,8 @@ function Gestures:isGestureAlwaysActive(ges, multiswipe_directions) | |||
end | |||
end | |||
|
|||
return self.gestures[ges] and self.gestures[ges].toggle_touch_input | |||
return self.gestures[ges] and (self.gestures[ges].toggle_touch_input or | |||
(self.gestures[ges].settings and self.gestures[ges].settings.always_active)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to add touch_input_off
to the list, as people might expect it to always work, like toggle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry i meant touch_onput_on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I got it, a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how often this is called, but if on all gesture, to make it possibly less expensive, you could factor out the first table lookup:
local ges = self.gestures[ges]
return ges and (ges.toggle_touch_input or ges.touch_input_on or...
Disabled touch input has become a popular feature. Let's enhance a bit:
-added separate actions "Touch input on", "Touch input off"
-added an option to make a gesture "always active" (even when the touch input is disabled)
This will help in cases like #10273.
I saw the @NiLuJe 's warning:
koreader/frontend/ui/widget/container/inputcontainer.lua
Lines 296 to 306 in b8af326
but couldn't get any errors while testing, at least in a usecase "enable page turns with the bottom edge swipes with disabled touch input". Maybe I've missed something...
This change is