cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Swipe Control

prathima
Associate II

Hello.....I want to know about the swiping .Basically i want to implement my own swipe for that i want to know at what place your handling the swipe control and how...i hope you will help me.I am currently working on STM32L4R9AI-eval.

Thank you....

1 ACCEPTED SOLUTION

Accepted Solutions

I'm afraid gestures are handled internally in closed source, that's why i suggested that you overwrite the handlers that you want (click, drag, gesture) and roll your own. The only thing you can change is the simple, single touch behavior which is defined in the TouchController class that you write for your touch controller.

This is our interface, your TouchController and what you read from that chip. We have not generalized gesture control, though we could.

Summary:

* TouchController reads a single x,y point. Results in call to handleClickEvent() on your screen.

* HAL (closed) evaluates, over time, whether this is a drag or e.g. a gesture (swipe). Results in calls to handleDragEvent() or handleGestureEvent() on your screen.

The following gestures are evaluated, automatically, internally:

typedef enum
    {
        SWIPE_HORIZONTAL, ///< An enum constant representing a horizontal swipe
        SWIPE_VERTICAL    ///< An enum constant representing a vertical swipe
    } GestureType;

 /Martin

View solution in original post

3 REPLIES 3
Martin KJELDSEN
Chief III

Hi,

TouchGFX implements its own gesture control (swipe, drag, touch). What you could do is override the methods that are called on the Screen to do nothing and then have your own task to register touch, gestures, etc and create your own data structure to signal this to views.

So, yea, it's not a built in thing that you can define your own gesture handling, but you can get around it in this way.

/Martin

Thank you dear Martin for your quick response...

but can you please tell me the exact location where your handling that swipe in project...so that i can rewrite it over there

I'm afraid gestures are handled internally in closed source, that's why i suggested that you overwrite the handlers that you want (click, drag, gesture) and roll your own. The only thing you can change is the simple, single touch behavior which is defined in the TouchController class that you write for your touch controller.

This is our interface, your TouchController and what you read from that chip. We have not generalized gesture control, though we could.

Summary:

* TouchController reads a single x,y point. Results in call to handleClickEvent() on your screen.

* HAL (closed) evaluates, over time, whether this is a drag or e.g. a gesture (swipe). Results in calls to handleDragEvent() or handleGestureEvent() on your screen.

The following gestures are evaluated, automatically, internally:

typedef enum
    {
        SWIPE_HORIZONTAL, ///< An enum constant representing a horizontal swipe
        SWIPE_VERTICAL    ///< An enum constant representing a vertical swipe
    } GestureType;

 /Martin