Buttonpress_event() in plugin querie.

This is where you talk about Plugins. How they are made and how they work, show examples.

Buttonpress_event() in plugin querie.

Postby beefy » Mon Apr 08, 2019 12:59 am

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.
beefy
 
Posts: 295
Joined: Mon Sep 05, 2016 10:34 am

Re: Buttonpress_event() in plugin querie.

Postby dezsoe » Mon Apr 08, 2019 5:32 am

Yes, it runs only once.
dezsoe
 
Posts: 805
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Buttonpress_event() in plugin querie.

Postby beefy » Mon Apr 08, 2019 10:39 am

Thanks Dezsoe,

that's what I wanted to hear.

Keith
beefy
 
Posts: 295
Joined: Mon Sep 05, 2016 10:34 am


Return to Plugins

Who is online

Users browsing this forum: Bing [Bot] and 3 guests