Jump to content

Need swipe gesture example


Recommended Posts

  • 3 months later...

Add the unit "W3Touch.pas", open it and have a look.

It's all there, you just have to add events for it :)

Gestures are introduced in TW3CustomControl:

 
    FOnGestureStart: TGestureStartEvent; 
    FOnGestureChange: TGestureChangeEvent; 
    FOnGestureEnd: TGestureEndEvent; 

 

Simply add an event-handler to your panel for each event, and catch the gesture information (you must include w3touch.pas to your uses clause).

 

Standard gestures like a swipe, well, I would just track the x pos of a touch and determine if it's less than the start position. You can also time the speed of the swipe (touch-start/end) and then decide if it should be considered a "swipe".

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...