How to dectect gestures?

Monkey Targets Forums/Android/How to dectect gestures?

Midimaster(Posted 2012) [#1]
How do you differ between a "moving" gesture of the fingers for scrolling and a click.

I want to build a list like it is often on Android Mobiles: The list is longer than the screen, but if your fingers move vertical over the lines, they begin to scroll.

Is this possible also with Monkey?


matty(Posted 2012) [#2]
The way I do these things is by keeping tabs on when the mouse is down and when it is released. When it changes from down to released then you have a click, while it is down handle the scrolling....


Kanati(Posted 2012) [#3]
So scrolling would probably be pretty simple. Just keeping the x/y of the background or image or whatever under the mouse/finger until it's released.

BUT... how would you handle multi-touch gestures like pinch to zoom and such?


Midimaster(Posted 2012) [#4]
I published some code about it, not perfect, but it shows the way:

http://www.monkeycoder.co.nz/Community/posts.php?topic=3718#bottom


and yesterday someone published a gesture class:

http://www.monkeycoder.co.nz/Community/posts.php?topic=3947


Kanati(Posted 2012) [#5]
Thanks. I think that gesture class is exactly what I was looking for.