✅ MAUI - Mutlitap Gesture
I haven't found anything on the net about "Multitap Gestures".
I tried a few things, currently using "CommunityToolkit.Maui" with the "TouchBehavior".
So I'm left with the question, is it even possible?
9 Replies
TapGestureRecognizer.NumberOfTapsRequired Property (Microsoft.Maui....
The number of taps required to trigger the callback. This is a bindable property.
Not sure if this is what you are after.
Thanks, but no.
By "Multitap" I mean the feature that recognizes "another" tap while being tapped, e.g. you place one finger on the screen and another afterwards, and so on, all of them should be recognized.
At the moment it's like a button pressed, so you cannot press it while being pressed already, which sounds plausible, but Touchscreens don't work this way, you can "press" a button/element while it's being pressed.
Ah. I think I understand. So like you are say holding a finger on one button and tap another button with a different finger?
Almost, tap the same element with multiple fingers - so that every finger is a tap event.
Right now the tap is like a button press (button down & up), if pressed/tap-started, it's not possible to start another one, because it not yet ended (button up).
My problem is that the logic of buttons doesn't apply to touchscreens, taps ain't buttons, so it seems to me unlogical to treat them like buttons.
Every tap should fire an event (or tapbehavior command), every finger touch should to that.
In addition there should be a
Count
of "taps/fingers" in the EventArgs
, but I don't need that, all I need is that every finger fires an event on touch/down.
I tried the built-in TapGestures, didn't work, so I gave it a try with the CommunityToolkit approach using TouchBehavior
.
It has some fancy animation stuff, but doesn't offer actually more features.
That's my current mess, I tried different events, but with no luck - I accidentally found a way to fire my Command
on ButtonUp and ButtonDown (TouchStatus), that's it^^
Apparently nobody seems to have an answer 😦Tbh, I do not know, am still new to programming. Someone else may have a better idea. I'm looking at something sort of similar. I'm trying to track multi finger touch position. From what I've read, skia sharp had a way to do so, but I haven't tried yet. Not sure if what you are wanting would be in there or not.
https://learn.microsoft.com/en-us/samples/dotnet/maui-samples/skiasharpmaui-demos/
.NET MAUI - SkiaSharp - Code Samples
This sample demonstrates the use of SkiaSharp in a .NET MAUI app.
My apologies, that wasn't much of a link
GitHub
GitHub - nor0x/TouchTracking.MAUI: Behavior providing a unified API...
Behavior providing a unified API for (multi-)touch gestures in .NET MAUI - nor0x/TouchTracking.MAUI
Can't actually believe it, but yeah, that's it!
What's so unbelievable is that it's not natively supported and only found in an unfinished/alpha state fork.
But that's MAUI waui ¯\_(ツ)_/¯
Thanks a lot!