iPlug2 / iPlug2

C++ Audio Plug-in Framework for desktop, mobile and web
https://iplug2.github.io
Other
1.9k stars 282 forks source link

Double taps on IOS go to OnGestureRecognized and don't map to OnMouseDblClick() #1048

Closed AlexHarker closed 6 months ago

AlexHarker commented 8 months ago

@olilarkin - what are your thoughts on the above?

olilarkin commented 8 months ago

I feel that it's not a problem. I do this...

#ifdef OS_IOS
    AttachGestureRecognizer(EGestureType::DoubleTap, [](IControl* pControl, const IGestureInfo& info){
      pControl->SetValueToDefault();
    });
#endif
olilarkin commented 8 months ago

Double tap is a OS defined gesture on IOS so this way double tapping responds the same way as it does elsewhere in the OS. Not 100% sure but the user might also be able to adjust the timing of double taps in the system settings

olilarkin commented 8 months ago

But adding gesture recognizers could be problematic for other interactions, so I didn't think it was a good idea to do it by default for all i controls

AlexHarker commented 8 months ago

Understood - that's useful clarification - I've gone about it a different way here using OnGesture() for the control and adding the recogniser to IGraphics, but I can't seem to get IOS to respond to the double taps - I see the Objective C style recogniser get attached, but its handler is never called.

olilarkin commented 7 months ago

can i close this or do you think it is something we should change?

AlexHarker commented 7 months ago

I need to ask you some questions so I can check if something is broken here, or if it is just my misunderstanding as I can't get it to work...

AlexHarker commented 6 months ago

closing due to implementation confusion at my end (no bug but it my approach couldn't work due to reliance on GetWantsGestures - which was non-virtual - this is now fixed in https://github.com/iPlug2/iPlug2/pull/1058)