Page 1 of 1

Buttonpress_event() in plugin querie.

PostPosted: Mon Apr 08, 2019 12:59 am
by beefy
A thought occurred to me about the Buttonpress_event(). If I have the following code (just pseudo code, not "real" code):

Code: Select all
public void Buttonpress_event(int buttonnumber, bool onscreen)
{
   if (onscreen)
   {
      if (buttonnumber == 1000)
      {
         // pseudo code to increment a DRO value:
         variable = DRO value;   // Get value from DRO
         variable += 1;         // Increment value
         DRO = variable;         // Write incremented value back to DRO
      }
   }
}


What would happen if the button was kept pressed down (mouse click and hold on the button) ???

Will this method only run once and not run again until the button was released and clicked again, or would the method run repeatedly while the button was held down.

I'm assuming that internally there are "mouse click down" and "mouse click up" events and this method will only run once for each "mouse click down", and not run again until there is a "mouse click up", and a subsequent "mouse click down".

Correct ???

Keith.

Re: Buttonpress_event() in plugin querie.

PostPosted: Mon Apr 08, 2019 5:32 am
by dezsoe
Yes, it runs only once.

Re: Buttonpress_event() in plugin querie.

PostPosted: Mon Apr 08, 2019 10:39 am
by beefy
Thanks Dezsoe,

that's what I wanted to hear.

Keith