Macro calling button that called it - what happens ???

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Macro calling button that called it - what happens ???

Postby beefy » Sun Jun 07, 2020 2:52 am

I want to trigger the Buttonpress_event() in a plugin with a screen button and/or a corresponding macro in gcode.

So my button number is 20,000 and my macro is M20000.

The first line in my macro is:
exec.Callbutton(20000);

So imagine I press the screen button and it calls the macro.
The macro then calls the button !!!!!!!!!!!
And then we end up with an endless loop (tested it).

So instead, can the macro call say button 20001, but this button DOES NOT ACTUALLY EXIST on the screen.
I would just want to use exec.Callbutton(20001) in the macro to call the plugin Buttonpress_event(), which would check if either the screen button 20000 or Callbutton(20001) had been issued.

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

Re: Macro calling button that called it - what happens ???

Postby beefy » Sun Jun 07, 2020 4:42 am

ALL GOOD NOW.

Basically answered my own questions with testing.

So for information for others, it appears calling a "phantom button" (one which does not exist on screen) in a macro still fires the Buttonpress_event() in a plugin.

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


Return to Macros

Who is online

Users browsing this forum: No registered users and 10 guests