Looking for a way to detect finger gestures in my Windows Mobile applications. Main goal: detect when user gestures a left or right swipe across the screen. Similar to the swipe motion used to unlock an iPhone.
+2
A:
Set a flag when a MouseDown
event occurs, storing the position as well.
- If you wish to react before the user removes his finger from the screen, listen to
MouseMove
events, and check the direction and distance relative to theMouseDown
event that you require for an action to take place. - If you wish to wait for the user to remove his finger from the screen first, listen to
MouseUp
events and check the direction and distance.
Tormod Fjeldskår
2009-04-13 17:16:39
Those would be the basic steps, yes. But then the fun starts in interpreting the results, translating into command (messages) and suppressing the normal commands trhe mouse generates.
Henk Holterman
2009-04-14 13:42:18