Skip to main content
prathima
Associate III
February 4, 2020
Solved

Custom Swipe Control

  • February 4, 2020
  • 3 replies
  • 1056 views

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....

This topic has been closed for replies.
Best answer by Martin KJELDSEN

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

3 replies

Martin KJELDSEN
Principal III
February 5, 2020

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

prathima
prathimaAuthor
Associate III
February 6, 2020

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

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
February 7, 2020

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