Button Listener called twice

Discussions and file drops for Auggie
Post Reply
MaynardC
Old Timer
Posts: 35
Joined: Wed Feb 27, 2013 4:28 am

Button Listener called twice

Post 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
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Button Listener called twice

Post 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
MaynardC
Old Timer
Posts: 35
Joined: Wed Feb 27, 2013 4:28 am

Re: Button Listener called twice

Post by MaynardC »

Thanks Art

That fixed it.

Maynard
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4592
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Button Listener called twice

Post by ArtF »

Thx, good to hear.

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 71 guests