Sorry to dredge up an old thread but this seems like the right place to ask.
I have been trying to do more or less exactly the above suggested approach for using commands to start/stop listening and then use those to gate commands that generate keys to send to the game so that some key sequences are only sent when one button is pressed and others when a second button is pressed.
Long story short, this seems to work exactly as expected if the command gated with a compare block is a simple command that does all the key sending. However, for any sequence that I want to send using a prefix/suffix arrangement it initially didn't seem to work for me. What I observed is that as soon as I introduce the compare block into the prefix command it seems to stop sending keys no matter what.
In other words, without the compare, I can press either joystick button and say the phrase, Voice Attack signals that the whole prefix/suffix phrase is recognized and the keys are sent. Conversely, when I add the compare to the prefix command, now when I press either joystick button I still see that the phrase is recognized but no keys are sent regardless of which button I press.
I tried the above technique with separate booleans instead of integer compares. Same result. I tried with an explicit "exit command" in the compare block body instead of using the flag on the end condition. Same result.
Originally I had set the prefix commands up to send a key -- opens a menu. Then the suffix commands were sending keys to select and item from the menu. My assumption was that the exit command was best placed in the prefix...you know, avoid doing any more work from that point you know that you want to exit kind of thing. Someone suggested that maybe the way to do this is to consolidate all the output work in the suffix and put the gate on that instead.
I tried that -- prefix command having no actions, just the phrase to say -- and then the suffix command has the tail end of the phrase to say and a set of actions to open the menu and select an item all in one go. When I add the compare block to the suffix in this case...voila, it all works again like you'd expect...only keys are sent when you press the right button for that suffix command.
So I guess I have a workaround -- just move the key sends that are in the prefixes right now in all the relevant suffixes that can go with that prefix. That seems less elegant however.
Is what I have observed the expected behavior or am I actually missing a trick?? I guess I'm trying to understand why gating the prefix command didn't work. It would be great to know if there's a better way to do this before I go re-edit all the suffixes I have set up again.