A Question about Button Events...
pauld
Junior Member
Hello All,
I wonder if I can have the external LEDs on a MVP8400 flash anytime a Button is pressed on the TP. So my question is, can I have 2 different button events pointing to the same button and have both execute everytime a button is pressed? Or do I have to make it work with just 1 Button Event?
for example.
Will this work?
I wonder if I can have the external LEDs on a MVP8400 flash anytime a Button is pressed on the TP. So my question is, can I have 2 different button events pointing to the same button and have both execute everytime a button is pressed? Or do I have to make it work with just 1 Button Event?
for example.
BUTTON_EVENT[dvTP1,0]
{
PUSH:
{
//PULSE THE EXTERNAL LEDs HERE
}
}
BUTTON_EVENT[dvTP1,6]
{
PUSH:
{
//DO SOMETHING
}
}
Will this work?
Comments
-
Yes, you can have duplicate and overlapping button events. I've done it by mistake enough to know they will all fire
. Event tables are created when the code starts running on the master, and any event in the tables will run on occurance of that event, without regard to how many times it appears in the tables ... at least, that is my observation. Whether there is some obscure technical limitation that isn't obvious, I would decline to say. -
Thank you Dave for the quick answer.
Paul -
I must caution about what may be an unexpected side effect when using channel 0 as you have here. If a button event is NOT processed by an event handler, the button event is sent to mainline (DEFINE_PROGRAM) for processing. Using channel 0 in an event cause every button event to be processed by the event handler that declared channel 0, so no button event would ever be sent to mainline for processing. ANy PUSH statements you may have had in mainline will never be executed.pauld wrote:BUTTON_EVENT[dvTP1,0] { PUSH: { //PULSE THE EXTERNAL LEDs HERE } }
If there are no PUSH or RELEASE statements in mainline, you are OK, but I wanted you to know of this behavior when using the global event handler. -
Thanks for the Heads-up but, I don't use mainline at all so I should be ok. I use Timelines for all my feedback etc
Paul -
Button array
Have you tryed to make a button array?
Something like this:
DEFINE_CONSTANT
INTEGER BUTTONS[]={1,2}
DEFINE_EVENT
BUTTON_EVENT[dv_PANELS,BUTTONS]
{
PUSH:
{
TO[BUTTON.INPUT] // AS WE HOLD THE BUTTON PUT IT ON
SWITCH(GET_LAST(BUTTONS))
{
CASE 1:
{
// DO SOMETHING
}
CASE 2:
{
// DO SOMETHING
}
}
}
}
Good luck -
ldeblank@jnv.nl wrote:Have you tryed to make a button array?
...
I did think about that, but in this case I believe the general Button Event is the most efficent way of doing what I need to.
Thanks for all the ideas everybody!
Paul
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums