Replies: 1 comment
-
Never mind. Upon reading more this is going to be virtually impossible. Better to just monitor the clicks in windows using one of these type methods: https://stackoverflow.com/questions/1316681/getting-mouse-position-in-c-sharp |
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 am attempting to design my own click management system based on a WindowOverlay:
https://github.com/dotnet/maui/tree/5e77c2a28a278f8e00f31d9692da2543c8086d6e/src/Core/src/WindowOverlay
In Windows, this method just adds a
W2DGraphicsView _graphicsView
element to the Window'sMicrosoft.Maui.Platform.WindowRootViewContainer
, and when set to_graphicsView.IsHitTestVisible = true
it takes the pointer events instead of them passing through to the underlying hierarchy.In Android, with the equivalent setup, I can selectively pass through clicks caught and managed by the Overlay using
View.DispatchTouchEvent()
which lets you manually pass through touch events to any specific Android Views.However, there are no such functions available in Windows, and I have spent at least 8 hours today trying to find a solution for passing clicks events selectively to other objects to activate their natural functions (like TextBoxes) with no luck.
When the WindowOverlay element is set to react to click events, I cannot find any way to make them go through to the underlying layers as well.
Even when the events are set to unhandled the events don't transmit down the hierarchy. This is to be expected perhaps as the
_graphicsView
in this setup is disconnected from the hierarchy. It is just an overlay sitting on top of theMicrosoft.Maui.Platform.WindowRootViewContainer
with no children for the events to traverse naturally.I need some way to invoke the click event into another path of the hierarchy but there are no public means for doing so. I am certain by Reflection there must be some way to do this, as the click events are getting into the system hierarchy somehow in the first place. Whatever function is introducing them is what I would ideally need.
How are the click functions getting into the hierarchy in the first place? It can't be voodoo.
Beta Was this translation helpful? Give feedback.
All reactions