Skip to main content
AD�?b
Senior
February 17, 2020
Question

How to do it?

  • February 17, 2020
  • 2 replies
  • 1523 views

I have the OFF / ON button. I want one function in the system to be called when the button is pressed and another function is pressed. The button is set to TRIGGER / Toggle. How to do it?

This topic has been closed for replies.

2 replies

scottSD
Senior III
February 17, 2020

By "Off/On" I assume you mean Toggle Button?

I assume you know you about the "Interaction" section in the TouchGFX Designer?

What do you mean you "want one function in the system to be called when the button is pressed and another function is pressed." --how is another function "pressed"?

AD�?b
AD�?bAuthor
Senior
February 18, 2020

1. yes

2. yes

3. when the button is OFF, the system works in one mode, as it is ON, the system works in another mode.

Romain DIELEMAN
ST Employee
February 18, 2020

Hi, as @scottSD wrote you should get familiar with the interaction section in Designer. Have a look at Tutorial 2 section 4 to see how to set-up a button and a function when the button is clicked. A Toggle button and a simple button like the one in the tutorial are quite similar. You can then code as you want the function handling the button click event to have a specific function called depending on the state of the button ON/OFF.

/Romain

AD�?b
AD�?bAuthor
Senior
February 18, 2020

Hi!

I'll see. Thank you!