by cncdrive » Sat Sep 17, 2016 2:08 pm
The UC.Getbutton function returns true while the button is being pressed and false when it is not being pressed by the user on the screen.
The purpose of this function is that in macros you can make a wait for a button press.
So, this function does not return the state of the toggle type buttons.
For that there is the UC.Getbuttonstate which returns the state of the toggle type button (on or off).
The bad thing is that I've checked the plugin interface and it seems in the current release this function is missing.
I'm not sure if it was accidentally removed or what have happened to it .. could not look after it in details yet.
So, the function is there in the macro interface only, but missing from the plugin interface.
I will place the function to the plugin interface now, so you can use it in the next release. (Should happen in about a week.)
Meanwhile I advice you to just run the button press event in "open loop", I mean the custom buttons start up always with off (false) state,
so if you will only control the on/off state from your plugin then you can follow the exact state of the button without the checking for it's state, just declare a boolean variable in your plugin which holds the state.
I know it is not the most elegant solution, but can be a workaround until the next relelase will fix the missing function issue.