Button Listener called twice

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Button Listener called twice

Re: Button Listener called twice

by ArtF » Thu Feb 18, 2016 3:26 pm

Thx, good to hear.

Art

Re: Button Listener called twice

by MaynardC » Thu Feb 18, 2016 2:19 pm

Thanks Art

That fixed it.

Maynard

Re: Button Listener called twice

by ArtF » Thu Feb 18, 2016 12:26 pm

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

Button Listener called twice

by MaynardC » Thu Feb 18, 2016 2:46 am

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

Top