Replies: 1 comment
-
It does seem it is impossible to create custom Gestures, but this class: https://github.com/dotnet/maui/tree/main/src/Core/src/WindowOverlay Has all the methods for accessing click and touch data and these can be used with |
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.
-
I like the way Behaviors and Gestures can be added to objects, but for Gestures to be useful, I would need to create my own GestureRecognizer with the following behaviors:
This seems simple and intuitive. Such a function will handle many versatile applications (including customization for swipe recognition, etc), but it is not built in.
I have looked at Gesture classes and they seem to be hardcoded from what I can tell. For example in GestureManager here I see bools hardcoded in for the various Gestures. So I speculate the system is not designed for adding GestureRecognizer classes.
Or is it?
Alternatively, I think I could create a global function that monitors the hardware mouse/touch input of the device (Android/iOS/Windows/etc). On click/touch, I could run
VisualTreeElementExtensions.GetVisualTreeElements
as per this link to see what is clicked.I think I might have to figure out mapping of operating system screen space vs. Maui screen space. As far as I can tell there is nothing for this or for direct input monitoring in Maui, right? These may be different too, I presume?
I could then create a Behavior type like
ReactsToClickBehavior
and attach it to elements I want to react to this manual Gesture. Then if any identified elements fromGetVisualTreeElements
has this Behavior, I could run a function on the Behavior subscribing to an object in my Input Monitor monitoring the active click/touch so it can react to those events.What do you think? What makes sense? Thanks for any thoughts.
Beta Was this translation helpful? Give feedback.
All reactions