1. support long press like flutter
What's this PR doing ?
#1. added new mouse event callback on DisplayObject called onLongPress.
how the new event longPress happed ?
yourdisplayobject.longPressDuration = Duration(seconds: 1.0);
yourdisplayobject.longPressDistance = 1.0;
yourdisplayobject.onLongPress((event){});
First of all, thanks for the PR! As GraphX originally tries to adapt to the ActionScript experience, I have some doubts regarding this type of computed gestures should be in an external decorator class. As multitouch input is also missing, might be an interesting feature to revisit how this works.
Regarding the longPress signal, it would be great to be able to configure the threshold distance and duration, on demand, how do think that should look like?
@roipeker Yes, we need configurable the duration and test distance. Maybe configure them on displayobject or others ?
Might be. Although Im still unsure about the addition on DisplayObject for this "compound" gesture... as you might as well create a mixin, or extension to add this behavior on top of the current input signals for your specific objects. Too bad that we should stay "idiomatic" with the Signal callbacks, otherwise something like onLongPress(timeout, distance).add(callback) would be an interesting option to not bloat so much the current loong api available in displayObject.
@roipeker yes, I am also think onLongPress(timeout, distance).add(callback) it's better solution. I will try it next a few days.
Hello, I am already finished it.
And more, I will start to multi-touch event next, did you have any ideas?
No idea in particular to be honest. Might start from stage for the basics events: down, move, release for each touch id