Replies: 1 comment
-
|
In the meantime I solved my personal use case by hooking into |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have a very specific use case, where specific user touch display interaction (touch, scroll, click, navigate, etc.) should trigger a "sleep timer reset". Now I have a whole UI and it could possibly worked into every single handler in there, but this would also bring a lot of added complexity.
Another use case I have is a
GestureHandlerthat should work as a Navigation action (e.g. swipe to go back to the last view), but still be able to use Sliders, which is kind of impossible depending on the size of the TouchArea overlapping the slider and not being able to control the events inplace.So I would like to ask, if it would be a good idea to implement event handling similar to the Browsers approach (JavaScript):
e.stopPropagation()ande.preventDefault()Here is a pretty good overview of how this works in the Browser:
https://www.freecodecamp.org/news/event-bubbling-and-event-capturing-in-javascript/
You can also interact with the handlers using the capture phase explicitly, e.g. if you'd like to check if a section is disabled before passing events to it:
This way you could solve the slider problem (by forcing
stopPropagation()on the element as well as the global handler problem (by leaving the bubbling intact).I don't know of any other way to solve my use case with Slint otherwise without a drastically higher effort of manual implementation instead of using a global TouchArea.pointer-event handler.
Here are some related discussions (some without solution) that I collected on my way:
Is there a way to intercept all input events in rust code?
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions