Skip to main content
wired
Senior II
October 28, 2021
Solved

Disable swipe acceleration for TouchGFX application

  • October 28, 2021
  • 1 reply
  • 976 views

I'm using the STM32F469I-DISCO board with TouchGFX. In portrait mode, I set the swipe threshold to 400 because I want the user to swipe almost all the way across the screen to switch pages. When I swipe slowly, it seems to work. However, a fast swipe changes pages with a swipe distance of only 1/2" or so. Is there a way to not make this speed-dependent?

This topic has been closed for replies.
Best answer by wired

So I filed a support request from ST, and they told me that the fast swipe feature is the default implementation. If you wish to make the swipeThreshold behave as it is documented in the API documentation, you must override the gesture handler in the screen that has the Swipe Container. See below for the added declaration. This is all that needs to be done - no function needs to be written. I suggested that they provide additional detail in the API for the swipeThreshold member so that people know it is only applicable for a slow swipe, and provide instructions an how to disable the fast swipe feature as shown below.

class Screen1View : public Screen1ViewBase
{
public:
 Screen1View();
 virtual ~Screen1View() {}
 virtual void setupScreen();
 virtual void tearDownScreen();
	
 virtual void handleGestureEvent(const GestureEvent& event) {}
 //event from Presenter
protected:
};
 

1 reply

wired
wiredAuthorBest answer
Senior II
December 15, 2021

So I filed a support request from ST, and they told me that the fast swipe feature is the default implementation. If you wish to make the swipeThreshold behave as it is documented in the API documentation, you must override the gesture handler in the screen that has the Swipe Container. See below for the added declaration. This is all that needs to be done - no function needs to be written. I suggested that they provide additional detail in the API for the swipeThreshold member so that people know it is only applicable for a slow swipe, and provide instructions an how to disable the fast swipe feature as shown below.

class Screen1View : public Screen1ViewBase
{
public:
 Screen1View();
 virtual ~Screen1View() {}
 virtual void setupScreen();
 virtual void tearDownScreen();
	
 virtual void handleGestureEvent(const GestureEvent& event) {}
 //event from Presenter
protected:
};