beginDragAutoRepeat touch input

Hi everyone,

I’m working on (a bit of) gesture parsing on a Component (inherited from TextButton).
A long “mouse down” should initiate a drag, indicated by a dragImage popping up.
I need to distinguish immediate drags from these after a short hold.

So I activate autorepeat in mouseDown(), and can handle everything in the mouseDrag() routine, regardless if it’s the dragging distance or duration that triggers the drag.
This works fine with mouse input.
However, when I touch the Component (preferred input), the line
if (s->isDragging() && ComponentPeer::getCurrentModifiersRealtime().isAnyMouseButtonDown())

in timerCallback() of MouseInputSource::SourceList doesn’t get passed, because no buttons are pressed (obviously my finger has none that could be :laughing:)
As a result, no fake moves are triggered.

Is this on purpose, Is there an easier way to achieve this?
Am I reinventing the wheel?

I’m on Windows10 (Surface pro 4).
By the way: a “long tap” here usually ends up with a right click - shouldn’t the right mouse button be virtually down?

Thanks for helping!

I worked on this to revamp a certain feature.

It all melts down to getNativeRealtimeModifiers returning “0”, although the touch’s modifier is “16”.
Shouldn’t this be improved?
Why can there be a mismatch at all?
Obviously it inhibits “beginDragAutoRepeat” expected behaviour of touch inputs [on windows?]…

In “juce_componentPeer.cpp” I removed the two lines

if (getNativeRealtimeModifiers != nullptr)
return getNativeRealtimeModifiers();

and everything works just fine…