how to simulate a push event of a button (also the code inside)
MorgoZ
Posts: 116
Hello!
I need to execute the block code inside a "push" event in a button, when another button is pushed.
I´ve tried with the "do_push" function, but it just turns the button on/off, it doesn´t execute the code inside the push block.
So i need to know if there is any other function that really simulates a push event of a button.
Any help?
Thanks!!!
I need to execute the block code inside a "push" event in a button, when another button is pushed.
I´ve tried with the "do_push" function, but it just turns the button on/off, it doesn´t execute the code inside the push block.
So i need to know if there is any other function that really simulates a push event of a button.
Any help?
Thanks!!!
0
Comments
I often use do_push to control modules from the .axi button_event and since I have options with do_push like _timed, do_release, etc I can simulate holds in my module just by using do_push_timed in the axi PUSH event handler and then issue a do_release in my RELEASE event handler. Then my module can have HOLD events with out the need to start and stop timelines off of channel triggers. Basically it acts as if I'm controlling the module directly from the TP with out the virtual middle man but the virtual middle man allows me to target my desired module instance. FYI, I never use the infinite time value but instead always use a default max timeout constant of 5 or 10 seconds just in case.
As long as you understand the do_push the do_push in all its flavors are your friend
As with most anything it can serve a purpose when used correctly. If you already have the BUTTON_EVENT code in a module there is no need to duplicate that programming under a CHANNEL_EVENT. And it's about the simplest method of generating a HOLD from a CHANNEL_EVENT without rolling your own with a WAIT or TIMELINE.