I'm using MWM as starting point / template for a floating menu.
How do I create a floating menu button that can be toggled between two or more states using action keyboard shortcuts. I have the menu options now as two separate buttons.
Your shortcut can update the menu item using the predefined action "Update Menu-ITEM Properties":
And you could also set a variable in your shortcut:
Such a variable can be checked in an if condition (it needs to have been set at least once to show up in the variables):
But it probably depends a lot on what you want to achieve, does it need to be controlled via keyboard shortcuts?
Hey Andreas, I use Hue in the menu app in which I've set Alt O for Light on and Alt F for light off. I like to toggle these states via one button in a floating menu (using MWM now as startingpoint). Recreated your example which turns the light off if already on but not the other way around.
you'd need to change the logic a bit. Move the "Set Value: On" into the else section and add another "Set Value: Off" to the if branch. That way it will toggle between the two.
changed it like this, but MenultemState is On keeps being true:
After restarting BTT I can turn the light on and then off only one time via the toggle button. Trying to turn on the light on again does not respond
is the type of the variable maybe set to number? In that case set it to 0 or 1 instead. However I think an even easier way might be to use the “cycle between multiple actions” action!
Variable type is set as default "Variable Type: Text".
Cycle through multiple actions (on repeated trigger) works like a charm . Any chance to also toggle the menu button icon for the different states (light on/off)? Solved it with Update Floating Menu-ITEM Properties action for every state. Not sure if this is the best/advised way?
Still strange that the MenuItemState not changes from On to Off as expected going through the IF-condition.
sure you can update the icon using the predefined action “update menu-item properties”. You can add it in your cycle action sequences
I’m not on my computer today, I can post a screenshot tomorrow if necessary.
Thanks for your reply this late in the weekend
Curious to get it working via the IF-condition. If you can send me a small working example which I can examine at your convinience it would be appreciated.
Have a great weekend (whats left of it)!