A Question about Button Events...
pauld
Posts: 106
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?
0
Comments
Paul
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.
Paul
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
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