cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX designer, Flex button or any other option available for Long Press of Touch button

ShivDesh
Associate III

Hello All,

 

I am new TouchGFX and working on it recently, I am trying to implement Long Press (if user touches button continuously) to increment value on Text Area, continuously until user releases flex button press.

Right now, the configuration for flex button to trigger is for Click, I can see option for Touch as well but it's not working as intended.  I can see the value update every Click but need to have value to increase as long as User Touch is Pressed.

Would appreciate, any guidance or some references to try out to do it.

 

Br,

Shiv

3 REPLIES 3
ShivDesh
Associate III

Hello Team,

Any suggestion or direction to try and experiment with for the flex button long press fixes?

 

Regards,

SD

JJhin.1
Senior II

you can do it with normal buttons. you have to create one interaction that gets triggers with every N tick and executes c++ code. there you can check button state by calling this  button.getPressedState() function, you can check button is pressed or not if pressed you can  increament variable continusly. check following example:

 

if(buttonUp.getPressedState()){
	uint16_t CrntVal = textProgress1.getValue();
	CrntVal++;
	textProgress1.setValue(CrntVal);	
}

if(buttonDw.getPressedState()){
	uint16_t CrntVal = textProgress1.getValue();
	if(CrntVal > 0)
		CrntVal--;
	else
		CrntVal =0;
	textProgress1.setValue(CrntVal);	
}

 

 

LouisB
ST Employee

Hello @ShivDesh,

You can refer to this post Solved: Re: Repeat Button triggers immediately, bug or fea... - STMicroelectronics Community.

BR,

Louis BOUDO
ST Software Developer | TouchGFX