Home AMX User Forum AMX General Discussion

button event for a tp array - what did i miss

okay, I am on site and perhaps just can't think straight, but I swear sober...

this is how I do my main button event:
BUTTON_EVENT[dvTPArrayMain, 0]
{
    PUSH:
    {

all of my touchpanels are in this tparray. i just noticed that if you press a button on a touchscreen, it calls my button event twice. if I switch my code to:
BUTTON_EVENT[dvTP5200iTS1, 0]
{
    PUSH:
    {

it works just fine. can i not use an array in that manor? how many places have i done this wrong! or is it wrong?

Should I be doing it more like:
BUTTON_EVENT[dvTP5200iTP1, 0]
BUTTON_EVENT[dvTP5200iTP2, 0]
BUTTON_EVENT[dvTP5200iTP3, 0]
{
    PUSH:
    {

Thanks,

Curt

Comments

  • ericmedleyericmedley Posts: 4,177
    Can you post your array declaration and the stuff below the Push: ?

    I can think of no reason that your array should fire twice. Perhpas there's something not posted that's causing the grief.
  • Crap, I was hoping to delete the post before someone responded...

    Seems a copy paste or copy replace went wrong at some point, the array had one of the touch panels (the one I was testing with) listed twice! all is fine now.

    Thanks for the help though!

    Curt
  • mpullinmpullin Posts: 949
    ninja edit fail
  • ericmedleyericmedley Posts: 4,177
    TrikinCurt wrote: »
    Crap, I was hoping to delete the post before someone responded...

    Seems a copy paste or copy replace went wrong at some point, the array had one of the touch panels (the one I was testing with) listed twice! all is fine now.

    Thanks for the help though!

    Curt


    That's funny since we're not the quickest ship at sea when it comes to respondig to postss.. Just look at it as an opportunity to get your post count up. 8P
  • DHawthorneDHawthorne Posts: 4,584
    I won't beat up your original issue, since you already found it, but as always I have to question using 0 for a parameter in an event. It's the wildcard, meaning any and all the buttons on those panels will trigger it. If anywhere else in your code you had a more specific event using any button, you also risk two events firing off. Perhaps you do your filtering inside the event, but I find it far easier to narrow down how many buttons are in the event table right from the start.

    I also wonder what this does to resource use. There is a limit to how large a single event table can be. You might find that higher button channel presses inexplicably won't work at all when you include all of them via the wildcard.
Sign In or Register to comment.