Page 1 of 1

Button Listener called twice

Posted: Wed Feb 17, 2016 3:46 pm
by MaynardC
If I add a Button with var name "CmdTest", toggle button = false, and place following code in a library

Code: Select all

global count =0;
global CmdTest= function(state) {
  if(state==1) {
    print("down " ,count);
    global count = count+ 1;
  }
};
the function is called twice, if I hold the button down for a short delay. Doesn't seem to occur for state=0.

Maynard

Re: Button Listener called twice

Posted: Thu Feb 18, 2016 1:26 am
by ArtF
Thanks Maynard,

  Ill check it here, and if it doesnt do it , Ill upload a new version, I know Ive been
quiet but a great deal of works been done with a huge amoun tof bugs found and fixed
again as we go, so that may already be fixed, but Ill check first. :)

  A non-Toggle button should get called only on press, and on release.. while the
toggle button will get called only on release and will toggle state.. (when working properly..) :)

Art

Re: Button Listener called twice

Posted: Thu Feb 18, 2016 3:19 am
by MaynardC
Thanks Art

That fixed it.

Maynard

Re: Button Listener called twice

Posted: Thu Feb 18, 2016 4:26 am
by ArtF
Thx, good to hear.

Art